Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

unixfs: feat tree building #284

Merged
merged 57 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
fa16bfd
feat: unixfs tree builder
Aug 5, 2020
de92475
feat: generate actual dag-pb
Aug 5, 2020
31e2a5e
fix: remove unneeded mut in render_directory
Aug 5, 2020
c59a4cb
refactor: try make /add streaming
Aug 5, 2020
ccd6bbe
feat: build directory trees on /add
Aug 5, 2020
f0bb5b4
feat: create empty directories without metadata
Aug 5, 2020
bb9555b
doc: explain anyhow dependency
Aug 5, 2020
548dbe2
chore: appease clippy
Aug 5, 2020
6ba4195
refactor: split dir/builder.rs up
Aug 5, 2020
a5b52b3
doc: add initial documentation
Aug 5, 2020
57737b4
refactor: detupleify into (Owned)?TreeNode
Aug 5, 2020
dd8d9d9
conformance: enable more directory tests
Aug 5, 2020
8319e8b
chore: remove extra clone (clippy)
Aug 6, 2020
4077de1
fix: report adderrors so that js-ipfs-http-client errors
Aug 6, 2020
65aceda
fix: normalize prefix slash away to enable more tests
Aug 6, 2020
14112c3
feat: /add?wrap_with_directory=true
Aug 6, 2020
5534fef
refactor: wrap_in_directory => wrap_with_directory
Aug 6, 2020
dc2c021
feat: /add?progress=true
Aug 6, 2020
a90826b
perf: avoid clearing block_buffer
Aug 6, 2020
653d079
doc: add note on HAMT sharding, adjust
Aug 6, 2020
3e499e1
perf: custom dag-pb serialization
Aug 6, 2020
9e948f9
perf: render Cids to bytes without allocating a Vec
Aug 6, 2020
f3b92d4
fix: replace todo! with Err(PathEndsInSlash)
Aug 6, 2020
1c71e3c
refactor: tests repeated the verify with block dump fn
Aug 6, 2020
39583a7
refactor: remove extra initialization
Aug 6, 2020
7bbff65
fix: DirBuilder::is_empty
Aug 6, 2020
7d7915a
doc: remove mention of wrap in => wrap with
Aug 6, 2020
5d8b124
doc: suggestions from code review
koivunej Aug 6, 2020
b134593
doc: minor too short sentence
Aug 6, 2020
7611248
feat: block size limit
Aug 6, 2020
f24f9bd
refactor: reorder items, fix doc
Aug 6, 2020
684ecdc
doc: note lld-9 ulimit -s bisection
Aug 6, 2020
41566e4
refactor(postorderiter): remove redundant visibilities
Aug 7, 2020
fdc5f8a
refactor: make PostOrderIterator 'static
Aug 7, 2020
e38c1ff
refactor: try splitting the huge func
Aug 6, 2020
8c10a0a
fix: remove calling ulimit
Aug 7, 2020
a3f27e5
fix: move all path matching to v0, box handlers
Aug 7, 2020
07c41c0
fix: tests after going from Infallible => Rejection
Aug 7, 2020
9a8267d
chore: update stack limit notes
Aug 8, 2020
25e56fd
add: missing fmt::Debug impl
Aug 8, 2020
dc4ff9c
add: tar ingestion example, bench
Aug 8, 2020
bcab2bd
refactor: move Visited under iter.rs
Aug 9, 2020
eb58b8b
test: output "actual" on test failure
Aug 9, 2020
19a62e2
refactor: use BTreeMap in dir_builder
Aug 9, 2020
56f1970
fix: use knowledge of longest path
Aug 9, 2020
3876717
doc: cleanup, rename, docs
Aug 9, 2020
3d48caa
refactor: custom pb types to own module
Aug 9, 2020
28392da
chore: cleanup, doc
Aug 9, 2020
5484f3e
fix: make the benchmark more generic
Aug 9, 2020
71b02cf
chore: cargo keeps changing the index file, clippy
Aug 9, 2020
7446810
doc: minor docs and fmt
Aug 9, 2020
9df95ad
refactor: remove duplicated ingest-tar example, it remains as bench
Aug 10, 2020
bfc1bf1
refactor: rename put_file => put_link
Aug 10, 2020
665c0c4
doc: comment touch ups
Aug 10, 2020
14c27fd
bench: move buffer and fix path growing outside
Aug 10, 2020
276e4b7
bench: filter symlinks earlier
Aug 10, 2020
aaabc37
doc: suggestions and notes from code review
koivunej Aug 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion unixfs/src/dir/builder/buffered.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{DirBuilder, Entry, Leaf, PostOrderIterator, TreeBuildingFailed, TreeOptions};
use crate::Metadata;
use cid::Cid;
use std::collections::hash_map::Entry::*;
use std::collections::btree_map::Entry::*;

/// UnixFs directory tree builder which buffers entries until `build()` is called.
#[derive(Debug)]
Expand Down
10 changes: 5 additions & 5 deletions unixfs/src/dir/builder/dir_builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{Entry, Leaf};
use crate::Metadata;
use std::collections::hash_map::Entry::*;
use std::collections::HashMap;
use std::collections::btree_map::Entry::*;
use std::collections::BTreeMap;

pub(super) struct DuplicateName;
pub(super) struct FoundLeaf;
Expand All @@ -10,7 +10,7 @@ pub(super) struct FoundLeaf;
#[derive(Debug)]
pub(super) struct DirBuilder {
/// Immediate files, symlinks or directories in this directory
pub nodes: HashMap<String, Entry>,
pub nodes: BTreeMap<String, Entry>,
/// Metadata for this directory
metadata: Metadata,
/// Id of the parent; None for the root node
Expand All @@ -23,7 +23,7 @@ impl DirBuilder {
pub fn new(parent_id: u64, id: u64) -> Self {
assert_ne!(parent_id, id);
DirBuilder {
nodes: HashMap::new(),
nodes: Default::default(),
metadata: Default::default(),
parent_id: Some(parent_id),
id,
Expand All @@ -32,7 +32,7 @@ impl DirBuilder {

pub fn root(id: u64) -> Self {
DirBuilder {
nodes: HashMap::new(),
nodes: Default::default(),
metadata: Default::default(),
parent_id: None,
id,
Expand Down
Loading