smiklosovic commented on code in PR #3562:
URL: https://github.com/apache/cassandra/pull/3562#discussion_r1911960469


##########
src/java/org/apache/cassandra/cql3/Validation.java:
##########
@@ -64,4 +70,28 @@ public static void validateKey(TableMetadata metadata, 
ByteBuffer key)
             throw new InvalidRequestException(e.getMessage());
         }
     }
+
+    public static void validateKeyAndCheckConstraints(TableMetadata metadata, 
ByteBuffer key)
+    {
+        validateKey(metadata, key);
+
+        List<ColumnMetadata> partitionKeys = metadata.partitionKeyColumns();
+        List<ColumnConstraint> partitionKeyConstraints = new 
ArrayList<>(partitionKeys.size());

Review Comment:
   Could not be partitionKeyConstraints already "cached" in `metadata`? 
Because, if I am getting that right, every single time we go to validate this, 
basically every single time we deal with ModificationStatement.addUpdates, we 
are creating new array list etc ... 



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