-
Notifications
You must be signed in to change notification settings - Fork 21
CNDB-15608 add TokenOnlyPrimaryKey class and isTokenOnly #2157
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
Conversation
Checklist before you submit for review
|
740185a to
914db36
Compare
src/java/org/apache/cassandra/index/sai/disk/v1/PartitionAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
No new regressions or failures related to this PR. |
722955d to
f2603c2
Compare
No new failures |
test/unit/org/apache/cassandra/index/sai/disk/v1/LegacyOnDiskFormatTest.java
Outdated
Show resolved
Hide resolved
pkolaczk
left a comment
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.
Requesting changes because some assertion messages should be definitely improved.
Besides that the code looks good and I had some minor nits / suggestions on further hardening it. This is up for discussion whether we want to do it here, or open followup issues.
src/java/org/apache/cassandra/index/sai/disk/v1/PartitionAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v1/PartitionAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v1/PartitionAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v2/RowAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v2/RowAwarePrimaryKeyFactory.java
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v2/TokenOnlyPrimaryKey.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v2/TokenOnlyPrimaryKey.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v2/TokenOnlyPrimaryKey.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/iterators/KeyRangeUnionIterator.java
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v1/PartitionAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
src/java/org/apache/cassandra/index/sai/disk/v2/RowAwarePrimaryKeyFactory.java
Outdated
Show resolved
Hide resolved
pkolaczk
left a comment
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.
Looks good. Found just two minor nits (javadoc and code formatting).
No rereview needed from my side.
eolivelli
left a comment
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.
+1
This failure was already fixed, so this is false positive from Butler. |
One already fixed test and the rest is not relevant. |
ca2efed to
54964d5
Compare
|
Merging the PR is blocked by #2157 |
It's part of the patch.
Addressing reviewers' comments - Be explicit about not thread safe - Improve assertion messages - Fix bug in primary key comparison - Make TokenOnlyPrimaryKey final and fix visibilities of members - Fix formatting - Fix RAM usage for TokenOnlyPrimaryKey - Fix to string conversion for TokenOnlyPrimaryKey
This removes need in a confusing assertion in another test for code coverage. Fixes explicit typing in the affected test file.
54964d5 to
600ba8d
Compare
|
❌ Build ds-cassandra-pr-gate/PR-2157 rejected by Butler2 regressions found Found 2 new test failures
Found 1 known test failures |



What is the issue
Part of https://github.com/riptano/cndb/issues/15608
The patch in CNDB-15608 will remove token from the partition key serialization, thus the case, when only token is provided in primary key, needs to be treated separately. Currently only token primary key case is blurred with complete or deferred primary keys.
What does this PR fix and why was it fixed
It implements clear separation for primary keys with token only by introducing own
TokenOnlyPrimaryKeyclass.It also implement
isOnlyToken()method, which is used instead of comparing partition key with null in appropriate cases (e.g., deferred partition key was loaded). New tests are added to exerciseTokenOnlyPrimaryKeymore and improve code coverage.CNDB's PR: https://github.com/riptano/cndb/pull/16258