linliu-code commented on code in PR #13977:
URL: https://github.com/apache/hudi/pull/13977#discussion_r2377228970


##########
hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileBlock.java:
##########
@@ -267,40 +268,41 @@ public ByteBuffer serialize() throws IOException {
     // Compress if specified.
     ByteBuffer compressedBlockData = 
context.getCompressor().compress(uncompressedBlockData);
     // Buffer for building block.
-    ByteBuffer buf = ByteBuffer.allocate(Math.max(
-        context.getBlockSize() * 2,
+    ByteArrayOutputStream baos = new ByteArrayOutputStream(Math.max(
+        context.getBlockSize(),

Review Comment:
   Previously I tried to give more extra bytes to Bytebuffer to reduce failures 
caused by cases where the same key with multiple records (not very rigorously). 
Now since we use ByteArrayOutputStream, this error should not exist. So we 
don't need these extra spaces).



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