maedhroz commented on code in PR #2540:
URL: https://github.com/apache/cassandra/pull/2540#discussion_r1283996585


##########
src/java/org/apache/cassandra/index/sai/utils/PrimaryKey.java:
##########
@@ -163,19 +159,61 @@ public String toString()
             }
         }
 
+        class TokenOnlyPrimaryKey extends AbstractPrimaryKey
+        {
+            private final Token token;
+
+            TokenOnlyPrimaryKey(Token token)
+            {
+                this.token = token;
+            }
+
+            @Override
+            public boolean isTokenOnly()
+            {
+                return true;
+            }
+
+            @Override
+            public Token token()
+            {
+                return token;
+            }
+
+            @Nullable
+            @Override
+            public DecoratedKey partitionKey()
+            {
+                return null;
+            }
+
+            @Nullable
+            @Override
+            public Clustering<?> clustering()
+            {
+                return null;
+            }

Review Comment:
   nit: I'd consider an override of `asComparableBytes()` here that throw 
`UnsupportedOperationException` instead of NPE.



-- 
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]

Reply via email to