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


##########
hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileMetaIndexBlock.java:
##########
@@ -33,27 +35,29 @@ public static HFileMetaIndexBlock 
createMetaIndexBlockToWrite(HFileContext conte
   }
 
   @Override
-  public ByteBuffer getUncompressedBlockDataToWrite() {
-    ByteBuffer buf = ByteBuffer.allocate(context.getBlockSize() * 2);
-    for (BlockIndexEntry entry : entries) {
-      buf.putLong(entry.getOffset());
-      buf.putInt(entry.getSize());
-      // Key length.
-      try {
-        byte[] keyLength = 
getVariableLengthEncodedBytes(entry.getFirstKey().getLength());
-        buf.put(keyLength);
-      } catch (IOException e) {
-        throw new RuntimeException(
-            "Failed to serialize number: " + entry.getFirstKey().getLength());
+  public ByteBuffer getUncompressedBlockDataToWrite() throws IOException {
+    ByteArrayOutputStream baos = new 
ByteArrayOutputStream(context.getBlockSize());

Review Comment:
   Answered below.



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