-
Notifications
You must be signed in to change notification settings - Fork 7
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 prefix filter to sstable2json #586
Add prefix filter to sstable2json #586
Conversation
} else { | ||
entry = sstable.getPosition(lastKey, SSTableReader.Operator.GT); | ||
} |
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.
won't this keep researching the sstable every key instead of scanning forward from the first ?
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 think there's two pieces at play here: sstable.getPosition
will have to binary search for the index for each key but dfile.seek
will only ever move forward from the previous seeked position. this means searching for a prefix that has 100 keys is the same as if you searched speciically for those 100 keys with -k
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 you had a "next prefix" supplied I think you would be able to run this like a normal range scan right? like "prefix1" is the left bound then "prefix2" is the next?
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.
good idea, added!
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 think with the update this
this means searching for a prefix that has 100 keys is the same as if you searched speciically for those 100 keys with
-k
is still the case
RowIndexEntry entry = sstable.getPosition(decoratedKey, keysCount == 0 ? SSTableReader.Operator.GE : SSTableReader.Operator.GT);
i think like @zpear said we can just use the on disk atom iterator until we hit untilPrefix (or until the prefix doesn't match anymore) instead of researching for every key
manual testing
|
talked offline — keeping the current implementation because
we want |
Enables finding all keys with a prefix within an sstable through sstable2json.