divijvaidya commented on code in PR #13135:
URL: https://github.com/apache/kafka/pull/13135#discussion_r1084093810
##########
clients/src/main/java/org/apache/kafka/common/compress/ZstdFactory.java:
##########
@@ -62,10 +68,11 @@ public void release(ByteBuffer buffer) {
}
};
- // Set output buffer (uncompressed) to 16 KB (none by default) to
ensure reasonable performance
- // in cases where the caller reads a small number of bytes
(potentially a single byte).
- return new BufferedInputStream(new ZstdInputStreamNoFinalizer(new
ByteBufferInputStream(buffer),
- bufferPool), 16 * 1024);
+ // We do not use an intermediate buffer to store the decompressed
data as a result of JNI read() calls using
+ // `ZstdInputStreamNoFinalizer` here. Every read() call to
`DataInputStream` will be a JNI call and the
+ // caller is expected to balance the tradeoff between reading
large amount of data vs. making multiple JNI
+ // calls.
+ return new DataInputStream(new ZstdInputStreamNoFinalizer(new
ByteBufferInputStream(buffer), bufferPool));
Review Comment:
1. Thanks for pointing out. This is an artifact of some other changes I was
trying to do. Fix it now.
--
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]