Skip to content

Conversation

@avelanarius
Copy link
Contributor

@avelanarius avelanarius commented Feb 25, 2022

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.


if (task.state.getLastConsumedChangeId().isPresent()) {
ChangeId lastConsumedChangeId = task.state.getLastConsumedChangeId().get();
streams = streams.filter(s -> s.compareTo(lastConsumedChangeId.getStreamId()) > 0);
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@haaawk haaawk left a 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?

@avelanarius
Copy link
Contributor Author

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.
@avelanarius
Copy link
Contributor Author

@haaawk Pushed v2 - reduced duplication of code.

@pkgonan
Copy link

pkgonan commented May 30, 2022

@avelanarius @haaawk
Hi. Is the scylladb cdc source connector not managed anymore?

https://github.com/scylladb/scylla-cdc-source-connector

@dkropachev dkropachev force-pushed the master branch 12 times, most recently from 3c4bf55 to 3318b32 Compare June 23, 2025 17:23
@dkropachev dkropachev force-pushed the master branch 8 times, most recently from 5031da9 to b5730b8 Compare August 2, 2025 13:14
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.

3 participants