adelapena commented on code in PR #2645:
URL: https://github.com/apache/cassandra/pull/2645#discussion_r1315708341
##########
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
Review Comment:
All `Kind` enums in the codebase are written in upper case, I think we
should use the same convention here.
##########
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:
It might be a bit confusing that a token-only object can be called a primary
key. I think we could add a short clarification on the class JavaDoc about why
we can have this kind of keys.
--
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]