CASSANALYTICS-79: Make Token ranges calculation rack aware for spark.data.partitioner.CassandraRing#149
Open
sklaha wants to merge 4 commits intoapache:trunkfrom
Open
CASSANALYTICS-79: Make Token ranges calculation rack aware for spark.data.partitioner.CassandraRing#149sklaha wants to merge 4 commits intoapache:trunkfrom
sklaha wants to merge 4 commits intoapache:trunkfrom
Conversation
yifan-c
reviewed
Jan 7, 2026
| return new long[]{h1, h2}; | ||
| } | ||
|
|
||
| protected static long invRShiftXor(long value, int shift) |
Contributor
There was a problem hiding this comment.
Why are those new methods added?
Comment on lines
+106
to
+118
| private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException | ||
| { | ||
| this.token = in.readUTF(); | ||
| this.node = in.readUTF(); | ||
| this.dataCenter = in.readUTF(); | ||
| } | ||
|
|
||
| private void writeObject(ObjectOutputStream out) throws IOException | ||
| { | ||
| out.writeUTF(token()); | ||
| out.writeUTF(nodeName()); | ||
| out.writeUTF(dataCenter()); | ||
| } |
Contributor
There was a problem hiding this comment.
Why adding the custom serialization code? The string fields should be serializable by default, and the readObject & writeObject methods are unnecessary.
Comment on lines
-37
to
+42
| private final String token; | ||
| private final String node; | ||
| private final String dataCenter; | ||
| private String token; | ||
| private String node; | ||
| private String dataCenter; |
Contributor
There was a problem hiding this comment.
Once readObject & writeObject are removed, the final modifiers can be restored.
Comment on lines
+77
to
78
| private transient RangeMap<BigInteger, List<CassandraInstance>> replicasForRanges; | ||
| private transient RangeMap<BigInteger, List<CassandraInstance>> replicas; |
Contributor
There was a problem hiding this comment.
It is confusing to have 2 maps and they actually point to the same object if I am not mistaken.
More importantly, it leads to different init code paths. The patch is to fix the broken token calculation, but why leaving it half-fixed? The CDC code patch still calls the original constructor, which means CDC is still broken.
Comment on lines
+152
to
+153
| //updateInternal(1, key, VALUE2); | ||
| //expectedValuesInNodes.put(1, VALUE2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in the PR: