Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitally use BufferedDAG after removing Batch from importers #5626

Merged
merged 2 commits into from
Oct 30, 2018

Conversation

Copy link
Contributor

@schomatis schomatis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split the Gx update in a separate commit to make it easier to see the changes to the logic?

@hsanjuan hsanjuan force-pushed the feat/impoter-batching branch from 79e3202 to 5b996cc Compare October 26, 2018 15:47
@hsanjuan
Copy link
Contributor Author

@schomatis done.

@@ -47,13 +47,31 @@ type Object struct {
Size string
}

// A batch-adding dag service for use with importers (and only for that)
// Always Commit() after adding.
type batching struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we make the DagBuilderHelper take separately an ipld.NodeAdder and an ipld.NodeGetter (or an adder + a separate DAGService) rather than just a DAGService, we need to wrap Batch in a DAGService, as it seems trickle uses Get.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it uses get as I think it does, we probably need to commit before calling get. Let's go with plan b and make Batch implement DAGService (flushing on get). (unless you can think of a better solution)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Stebalien yeah i'll do that to be on the safe side.

@hsanjuan hsanjuan force-pushed the feat/impoter-batching branch from 5b996cc to 2d7033c Compare October 27, 2018 01:35
@hsanjuan hsanjuan changed the title Explicitally use Batch after removing it from importers Explicitally use BufferedDAG after removing Batch from importers Oct 27, 2018
@hsanjuan
Copy link
Contributor Author

@Stebalien @schomatis this ready using BufferedDAG with all bubbled.

@hsanjuan
Copy link
Contributor Author

I'm not sure test failures have anything to do with this

@hsanjuan hsanjuan force-pushed the feat/impoter-batching branch from 2d7033c to 349925e Compare October 29, 2018 11:48
Copy link
Contributor

@schomatis schomatis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hsanjuan hsanjuan force-pushed the feat/impoter-batching branch from 349925e to 9fde50b Compare October 29, 2018 17:43
License: MIT
Signed-off-by: Hector Sanjuan <[email protected]>
License: MIT
Signed-off-by: Hector Sanjuan <[email protected]>
@hsanjuan hsanjuan force-pushed the feat/impoter-batching branch from 9fde50b to 8709e55 Compare October 29, 2018 17:49
@@ -49,11 +49,14 @@ type Object struct {

// NewAdder Returns a new Adder used for a file add operation.
func NewAdder(ctx context.Context, p pin.Pinner, bs bstore.GCBlockstore, ds ipld.DAGService) (*Adder, error) {
bufferedDS := ipld.NewBufferedDAG(ctx, ds)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll probably refactor this to happen on the coreapi layer (next to offline/sessions stuff), but this is good enough for now

@Stebalien Stebalien merged commit 0182659 into master Oct 30, 2018
@ghost ghost removed the status/in-progress In progress label Oct 30, 2018
@Stebalien Stebalien deleted the feat/impoter-batching branch October 30, 2018 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants