-
Notifications
You must be signed in to change notification settings - Fork 18
Read windows with lastConsumedChangeId efficiently #68
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
base: master
Are you sure you want to change the base?
Conversation
|
|
||
| if (task.state.getLastConsumedChangeId().isPresent()) { | ||
| ChangeId lastConsumedChangeId = task.state.getLastConsumedChangeId().get(); | ||
| streams = streams.filter(s -> s.compareTo(lastConsumedChangeId.getStreamId()) > 0); |
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.
Is compareTo on StreamId doing the right thing? Is it using the same sorting order as a select would use? That means the order of tokens of partition keys.
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.
Yes, as far as I tested this did the right thing. Also the integration tests verify that assumption.
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 in general but it seems that lots of code were duplicated now. Would there be a way to reduce the duplication a bit?
Yes, I'll work on that. |
Read windows with present lastConsumedChangeId more efficiently. Instead of filtering out rows on the client side, perform two queries to Scylla: first - reading a single partial stream, second - reading all consecutive entire streams.
9d84258 to
30edf92
Compare
|
@haaawk Pushed v2 - reduced duplication of code. |
|
@avelanarius @haaawk |
012c0c8 to
c89661c
Compare
78c0d0b to
0fc243b
Compare
3c4bf55 to
3318b32
Compare
5031da9 to
b5730b8
Compare
Read windows with present lastConsumedChangeId more efficiently. Instead of filtering out rows on the client side, perform two queries to Scylla: first - reading a single partial stream, second - reading all consecutive entire streams.
TODO: Two modes of reading - single stream and multiple stream selects.