yifan-c commented on code in PR #4459:
URL: https://github.com/apache/cassandra/pull/4459#discussion_r2491787586
##########
src/java/org/apache/cassandra/db/compression/ZstdCompressionDictionary.java:
##########
@@ -69,6 +71,29 @@ public byte[] rawDictionary()
return rawDictionary;
}
+ @Override
+ public int occupiedMemory()
+ {
+ int occupied = rawDictionary.length;
+ if (dictDecompress != null)
+ {
+ ByteBuffer buffer = dictDecompress.getByReferenceBuffer();
+ if (buffer != null)
+ occupied += buffer.capacity();
+ }
+
+ Iterator<ZstdDictCompress> iterator =
zstdDictCompressPerLevel.values().iterator();
+ while (iterator.hasNext())
+ {
+ ZstdDictCompress next = iterator.next();
+ ByteBuffer byteBuffer = next.getByReferenceBuffer();
Review Comment:
I do not think the `ZstdDictCompress` and `ZstdDictDecompress` are backed by
shared bytebuffer. So `getByReferenceBuffer` **will just return null**.
I did not create the compress and decompress objects using the shared
bytebuffer because `CompressionDictionary` is shared already. Maybe we can
revisit the idea.
--
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]