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


##########
src/java/org/apache/cassandra/cql3/QueryProcessor.java:
##########
@@ -149,6 +149,7 @@ public void preloadPreparedStatements()
                     clientState.setKeyspace(keyspace);
 
                 Prepared prepared = parseAndPrepare(query, clientState, false);
+                prepared.cacheEntrySize = measureCacheEntrySize(id, prepared);

Review Comment:
   I don't have a strong opinion here so :shrug: 
   
   But when moving `measureCacheEntrySize(Object key, Prepared value)` I 
noticed it measures both the key and the value. Having a pstmnt calculate and 
hold it's size sgtm. But the pstmnt having it's size calculated with the size 
of a random key factored in makes no sense. Specially when that key is going to 
be implementation specific to a particular cache. That's not right.
   
   What about having pstmnt having it's size precalculated and on 
`QueryProcessor` we pull that and calculate the cache entry size?



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