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


##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -797,9 +801,17 @@ public static CQLStatement.Raw parseStatement(String 
queryStr) throws SyntaxExce
         }
     }
 
-    private static int measure(Object key, Prepared value)
+    private static int measurePstmnt(Prepared value)
     {
-        return Ints.checkedCast(ObjectSizes.measureDeep(key) + 
ObjectSizes.measureDeep(value));
+        return Ints.checkedCast(ObjectSizes.measureDeep(value));
+    }
+
+    private static int getSizeForCache(MD5Digest key, Prepared value)
+    {
+        if (value.pstmntSize < 0)

Review Comment:
   is this actually ever going to happen? I think `assert value.pstmntSize > 0` 
is enough. `> 0` because I don't think having size of 0 makes sense. It is 
invalid size too.



##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -797,9 +801,17 @@ public static CQLStatement.Raw parseStatement(String 
queryStr) throws SyntaxExce
         }
     }
 
-    private static int measure(Object key, Prepared value)
+    private static int measurePstmnt(Prepared value)
     {
-        return Ints.checkedCast(ObjectSizes.measureDeep(key) + 
ObjectSizes.measureDeep(value));
+        return Ints.checkedCast(ObjectSizes.measureDeep(value));
+    }
+
+    private static int getSizeForCache(MD5Digest key, Prepared value)
+    {
+        if (value.pstmntSize < 0)

Review Comment:
   @bereng is this actually ever going to happen? I think `assert 
value.pstmntSize > 0` is enough. `> 0` because I don't think having size of 0 
makes sense. It is invalid size too.



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