blerer commented on code in PR #2488:
URL: https://github.com/apache/cassandra/pull/2488#discussion_r1270315801
##########
src/java/org/apache/cassandra/fql/FullQueryLogger.java:
##########
@@ -508,16 +545,14 @@ public void release()
queryOptionsBuffer.release();
}
- @Override
- public int weight()
+ /**
+ * Returns the sum of the non primitive fields sizes.
+ * @return the sum of the non primitive fields sizes.
+ */
+ protected long fielsdSize()
{
- return OBJECT_HEADER_SIZE
- + Long.BYTES
// queryStartTime
- + Integer.BYTES
// protocolVersion
- + OBJECT_REFERENCE_SIZE + EMPTY_BYTEBUF_SIZE +
queryOptionsBuffer.capacity() // queryOptionsBuffer
- + Long.BYTES
// generatedTimestamp
- + Long.BYTES
// generatedNowInSeconds
- + OBJECT_REFERENCE_SIZE +
Ints.checkedCast(ObjectSizes.sizeOf(keyspace)); // keyspace
+ return EMPTY_BYTEBUF_SIZE + queryOptionsBuffer.capacity() //
queryOptionsBuffer
+ + ObjectSizes.sizeOf(keyspace); //
keyspace
Review Comment:
The original computation was ignoring in it computation a certain amount of
things. You can sum up object shallow size to get the deep size but when
computing the shallow size you need to be careful as the logic is not a simple
sum.
--
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]