brandboat commented on code in PR #15589:
URL: https://github.com/apache/kafka/pull/15589#discussion_r1536846618
##########
clients/src/main/java/org/apache/kafka/common/telemetry/internals/ClientTelemetryUtils.java:
##########
@@ -204,16 +202,14 @@ public static byte[] compress(byte[] raw, CompressionType
compressionType) throw
public static ByteBuffer decompress(byte[] metrics, CompressionType
compressionType) {
ByteBuffer data = ByteBuffer.wrap(metrics);
try (InputStream in = compressionType.wrapForInput(data,
RecordBatch.CURRENT_MAGIC_VALUE, BufferSupplier.create());
- ByteArrayOutputStream out = new ByteArrayOutputStream()) {
-
+ ByteBufferOutputStream out = new ByteBufferOutputStream(1)) {
Review Comment:
`1` is a little bit too small I think, to avoid too many expandBuffer
invocation, maybe we can use 32 (which is the default byte array value in
ByteArrayOutputStream) or 64 ? @chia7712 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]