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


##########
src/java/org/apache/cassandra/db/compression/CompressionDictionaryCache.java:
##########
@@ -101,7 +105,10 @@ public void add(@Nullable CompressionDictionary 
compressionDictionary)
 
         // Only update cache if not already in the cache
         DictId newDictId = compressionDictionary.dictId();
-        cache.get(newDictId, id -> compressionDictionary);
+        cache.get(newDictId, id -> {
+            totalSize.addAndGet(compressionDictionary.rawDictionary().length);

Review Comment:
   The addition of such a method is already in CASSANDRA-20941, we might just 
reuse it here once that work is merged and hide other computations behind that. 
`size` method would return only length of dictionary byte array so if we want 
to return more, based on your above comment, we would have something like 
"rawSize" or "occupiedMemory" or similar rather than pure `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