This repository was archived by the owner on Aug 12, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Builder refactoring, trickle builder and balanced builder #118
Merged
Merged
Changes from 3 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
511c746
builder refactoring. trickle builder. balanced builder
pgte 0e3f158
removed unused experimental builder
pgte 6af7458
documented importer options
pgte 977f41b
default builder strategy is now the balanced strategy
pgte c767848
removed unused test
pgte 7854682
removed superfluous comment
pgte df48f69
fixed trickle builder
pgte 50c5d35
removed superfluous comment
pgte cbe2ce4
using options.chunkerOptions for chunker-specific options
pgte f8b9e80
docs: corrected option name
pgte fedfc30
fix: error handling in trickle reducer
pgte 8e8d3d6
using pull-pair instead of backpressure-less bespoke pair
pgte 7647657
fixed trickle builder tests
pgte 74482f3
recursive streaming trickle builder
pgte 2b92345
missing dep
pgte 01d8583
some style corrections
pgte 0036314
importing multiple roots yields an error
pgte 02cdefd
reinstated testing importing using flat and balanced strategies
pgte 8ac163c
asserting that root node is one and only one
pgte e723586
testing import and export using various builder strategies
pgte b9a01f8
fixed error propagation into push streams
pgte 03f49d4
simplified some iteration logic
pgte fedbe5f
default for maximum children pre node is 174
pgte 180b808
by default, only reduces one leaf to self if specific option is present
pgte 937c292
test results reflect new default config
pgte 0f706df
testing against big files genearted from a pseudo random byte stream gen
pgte 0d3602e
added missing dep
pgte 973c483
removed unnecessary dev dependency
pgte 67fbf87
go-ipfs parity: no root node with single leaf
pgte ff6cce5
docs: corrected the default maximum number of children nodes
pgte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,7 +163,7 @@ In the second argument of the importer constructor you can specify the following | |
* `trickle`: builds [a trickle tree](https://github.com/ipfs/specs/pull/57#issuecomment-265205384) | ||
* `maxChildrenPerNode` (positive integer, defaults to `172`): the maximum children per node for the `balanced` and `trickle` DAG builder strategies | ||
* `layerRepeat` (positive integer, defaults to 4): (only applicable to the `trickle` DAG builder strategy). The maximum repetition of parent nodes for each layer of the tree. | ||
|
||
* `reduceSingleLeafToSelf` (boolean, defaults to `false`): optimization for, when reducing a set of nodes with one node, reduce it to that node. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👌🏽 |
||
|
||
### Example Exporter | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
const balancedReducer = require('./balanced-reducer') | ||
|
||
const defaultOptions = { | ||
maxChildrenPerNode: 172 | ||
maxChildrenPerNode: 174 | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add a comment with a link to https://github.com/ipfs/go-ipfs/blob/master/importer/helpers/helpers.go#L16-L35 so that we remember where this value comes from |
||
|
||
module.exports = function (reduce, _options) { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now defaults to 174