-
Notifications
You must be signed in to change notification settings - Fork 4
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
support prefix scans in ResponsiveKeyValueStore #411
Conversation
) { | ||
final Bytes from = Bytes.wrap(prefixKeySerializer.serialize(null, prefix)); | ||
final Bytes to = Utils.incrementWithoutOverflow(from); | ||
return doRange(kafkaPartition, from, to, streamTimeMs, this.prefix); |
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.
very nitpicky but why use range
above but this.prefix
here? Can only afford one this
? 😛
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's because this has prefix
in the parameters so there's a scoping conflict whereas range doesn't have that. I'll use this
for both for symmetry if you demand it haha
kafka-client/src/main/java/dev/responsive/kafka/internal/db/CassandraKeyValueTable.java
Outdated
Show resolved
Hide resolved
try { | ||
return Bytes.increment(input); | ||
} catch (final IndexOutOfBoundsException e) { | ||
return null; |
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.
what are the semantics of an upper bound of null
in Mongo and Scylla? Semantically it should just not apply any upper bound at all, is that what they both 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.
Good call, fixed bugs and added tests.
@@ -196,6 +197,40 @@ public void shouldReturnRangeKeysInLexicalOrderAcrossMultipleSubPartitions() { | |||
} | |||
} | |||
|
|||
@Test |
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.
Can we add a test that hits the overflow case? Would be good to have one for each table type to make sure the underlying engine does the right thing
fixes #408
Support prefix scans on:
CassandraKeyValueTable
MongoKeyValueTable
InMemoryKeyValueTable
We don't support range scans on Global tables (yet),
CassandraFactTable
orRS3KeyValueTable
yet.