Jackie-Jiang commented on code in PR #12802:
URL: https://github.com/apache/pinot/pull/12802#discussion_r1554093531


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/compression/GzipCompressor.java:
##########
@@ -43,14 +43,17 @@ public int compress(ByteBuffer inUncompressed, ByteBuffer 
outCompressed)
     _compressor.setInput(inUncompressed);
     _compressor.finish();
     _compressor.deflate(outCompressed);
+    outCompressed.putInt(inUncompressed.limit()); // append uncompressed size

Review Comment:
   It should be safer to use `Deflater.getBytesRead()` in case the input buffer 
doesn't start from position 0. Alternatively we can call 
`inUncompressed.remaining()` before feeding it into the `Deflater`



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

Reply via email to