maedhroz commented on code in PR #2645:
URL: https://github.com/apache/cassandra/pull/2645#discussion_r1316168697
##########
src/java/org/apache/cassandra/index/sai/utils/PrimaryKey.java:
##########
@@ -17,34 +17,56 @@
*/
package org.apache.cassandra.index.sai.utils;
+import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Objects;
-import java.util.function.Supplier;
import java.util.stream.Collectors;
-import javax.annotation.Nullable;
-
+import org.apache.cassandra.db.BufferDecoratedKey;
import org.apache.cassandra.db.Clustering;
import org.apache.cassandra.db.ClusteringComparator;
import org.apache.cassandra.db.DecoratedKey;
+import org.apache.cassandra.db.marshal.ByteBufferAccessor;
+import org.apache.cassandra.dht.IPartitioner;
import org.apache.cassandra.dht.Token;
import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.utils.bytecomparable.ByteComparable;
import org.apache.cassandra.utils.bytecomparable.ByteSource;
+import org.apache.cassandra.utils.bytecomparable.ByteSourceInverse;
/**
* Representation of the primary key for a row consisting of the {@link
DecoratedKey} and
* {@link Clustering} associated with a {@link
org.apache.cassandra.db.rows.Row}.
*/
public interface PrimaryKey extends Comparable<PrimaryKey>, ByteComparable
{
+ /**
+ * See the javadoc for {@link #kind()} for how this enum is used.
+ */
+ enum Kind
+ {
+ Token(false),
Review Comment:
Yeah, I had that thought as well. Agree on the JavaDoc in lieu of a better
concept that encompasses all the types. Something like `IndexKey` that could
really be a token, partition key, or real compound primary key...but calling it
a `PrimaryKey` is technically correct in most cases and descriptive when it is.
The only other thing is we could follow the example of `RingPosition` or
something and have like...`IndexPosition` which our `PrimaryKey` and also just
the token implement for comparisons (which is the only reason we have the
token-only thing...to be comparable for skipping, right?)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]