-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add --stream option to ls
command
#5611
Conversation
ping @achingbrain |
7dadaa5
to
557630a
Compare
557630a
to
3b19e7e
Compare
Rebased on master, pending updated go-unixfs. However, in the meantime, ready for review @eingenito @Stebalien @magik6k |
Some imports are broken, see jenkins. Try running |
@magik6k the issue is while the code for this is merged into go-unixfs, no new version is published. Is there an appropriate process to update and publish a subpackage like go-unixfs? |
You just run Then if the thing you are trying to update has dependencies, run Alternatively, if there are no breaking/few changes and more than say 2-3 dependencies you should try |
8033722
to
a4e3897
Compare
a4e3897
to
15707d7
Compare
This is now unblocked. Can someone review it? |
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.
I am not really happy with all the extra flags and would like to find another way if possible.
@Stebalien This is now blocking #5464. Could we get #5663 in first or separate out the switch to a new commands library into a separate p.r. |
If required I would be happy to either separate out the command lib. stuff in a separate commit or rebase this on top of #5663. It shouldn't be that hard and I am not sure I am happy with how things are implemented right now so it may take awhile to get this in. |
uses single flag to support state needed by PostRun supports encoding=text License: MIT Signed-off-by: hannahhoward <[email protected]>
License: MIT Signed-off-by: hannahhoward <[email protected]>
License: MIT Signed-off-by: hannahhoward <[email protected]>
b756376
to
b0dc73c
Compare
@Stebalien this incorporates @kevina 's last round of suggestions and I think is ready to merge, pending your approval. |
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.
LGTM now.
There is one comment by @magik6k that I think should be addressed, but we can also clean that up later.
core/commands/ls.go
Outdated
|
||
func makeDagNodeLinkResults(req *cmds.Request, dagnode ipld.Node) <-chan unixfs.LinkResult { | ||
linkResults := make(chan unixfs.LinkResult) | ||
go func() { |
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.
I agree, but we can clean this up afterwards.
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.
See comment.
bcb9d26
to
0a5b1a2
Compare
License: MIT Signed-off-by: hannahhoward <[email protected]>
0a5b1a2
to
f5ab6a3
Compare
@Stebalien there is one minor issue (keeping me from approving) but otherwise this LGTM. |
Thank @hannahhoward and everyone that reviewed this. Finding a solution when there is no good solution is painful and difficult but you all managed to do it. 🎉 |
Thanks @Stebalien and @kevina and @magik6k for all the feedback! |
N.b will not actually do any streaming until ipfs/kubo#5611 lands
N.b will not actually do any streaming until ipfs/kubo#5611 is released.
The only mfs ls method at the moment buffers the output into an array before returning it to the user. This PR adds two new methods, lsPullStream and lsReadableStream to allow the user to either buffer the output themseleves (in case they need sorting, etc) or just stream it on to an output of some sort. N.b the http API will not actually do any streaming until ipfs/kubo#5611 is released.
N.b will not actually do any streaming until ipfs/kubo#5611 lands
The only mfs ls method at the moment buffers the output into an array before returning it to the user. This PR adds two new methods, lsPullStream and lsReadableStream to allow the user to either buffer the output themseleves (in case they need sorting, etc) or just stream it on to an output of some sort. N.b the http API will not actually do any streaming until ipfs/kubo#5611 is released.
Features
Adds the option to stream results from ls -- so that large directories (particularly HAMT dirs) start returning data immediately instead of waiting for the whole DAG to be walked
Fixes #5600
Requires ipfs/go-unixfs#39
Implementation
For Discussion