linliu-code commented on code in PR #12866:
URL: https://github.com/apache/hudi/pull/12866#discussion_r2105885833
##########
hudi-io/src/main/java/org/apache/hudi/io/hfile/HFileFileInfoBlock.java:
##########
@@ -61,4 +69,39 @@ public HFileInfo readFileInfo() throws IOException {
}
return new HFileInfo(fileInfoMap);
}
+
+ // ================ Below are for Write ================
+
+ public HFileFileInfoBlock(HFileContext context) {
+ super(context, HFileBlockType.FILE_INFO, -1L);
+ }
+
+ public void add(String name, byte[] value) {
+ entries.put(name, value);
+ }
+
+ @Override
+ public ByteBuffer getPayload() {
+ ByteBuffer buff = ByteBuffer.allocate(context.getBlockSize() * 2);
+ HFileProtos.InfoProto.Builder builder =
+ HFileProtos.InfoProto.newBuilder();
+ for (Map.Entry<String, byte[]> e : entries.entrySet()) {
+ HFileProtos.BytesBytesPair bbp = HFileProtos.BytesBytesPair
+ .newBuilder()
+ .setFirst(ByteString.copyFrom(getUTF8Bytes(e.getKey())))
+ .setSecond(ByteString.copyFrom(e.getValue()))
Review Comment:
Cannot; wrap is a package-private fucntion.
--
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]