DL1231 commented on code in PR #20847:
URL: https://github.com/apache/kafka/pull/20847#discussion_r2575406120


##########
clients/src/main/java/org/apache/kafka/common/utils/BufferSupplier.java:
##########
@@ -30,6 +31,7 @@
  * iterating over the records in the batch.
  */
 public abstract class BufferSupplier implements AutoCloseable {
+    protected final AtomicLong cachedSize = new AtomicLong();

Review Comment:
   As @chia7712 mentioned, the cached size actually refers to the total size of 
the buffers that are cached. 
   In practice, a larger buffer might be allocated due to a large message, but 
it may not be cached due to the limitation of append.max.buffer.size. 
   Therefore, calculating it directly might lead to some inaccuracies. 
Alternatively, when counting the cached size, we could apply the same criteria 
as used in the `freeCurrentBatch`. WDYT?



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

Reply via email to