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.
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
Streaming iterator spike #342
Streaming iterator spike #342
Changes from 6 commits
969684f
c806b7a
9bb6cd3
46aecef
116d83b
0c31eb9
f5e69c6
e6e36d0
e25d42b
8273434
36ce8cc
4d5f65c
692018a
17f4713
7ab9003
4867f82
afe6357
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Will all this TODOs be tracked in a issue so that we won't forget about it? All of them seem a must do.
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.
This was fixed in #346
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.
It would be better to wrap this in an enum so that impossible stakes cannot be represented.
or whatever.
Right now, it's possible for the type to have both a starting-key and a current-key, which shouldn't be the case, right?
I'm not looking too far in depth, so I could have missed something, but if we can't represent impossible states, there will be fewer code-paths.
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.
If I'm not mistaken, if I don't pass in a key to the
get_iter
method, it'll hit this every time instead of starting from the root, right?Whether I'm right or wrong, there should be a test for an empty key.
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 can't do the empty key test yet because it's not implemented. I need to add code that walks down the leftmost branch every time and returns that key, which doesn't currently exist.
I'm thinking about not using the existing get_node_and_parents_by_key or refactoring it so it supports:
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.
nit: Why not remove this line?
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.
Fixed in #346
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.
You should also add tests for returning a stream for an empty trie, inserting a node at the key, then making sure the first value in the stream is that node.
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.
This test will happen after
StartAtBeginning
is implemented in the next PR.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.
That's only one case. There are cases here that can be tested now. The logic that has been added here should be accompanied by tests to test the cases.