prashantwason commented on a change in pull request #4067:
URL: https://github.com/apache/hudi/pull/4067#discussion_r755744509



##########
File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieHFileDataBlock.java
##########
@@ -162,6 +167,18 @@ protected void createRecordsFromContentBytes() throws 
IOException {
     return records;
   }
 
+  /**
+   * Serialize the record to byte buffer.
+   *
+   * @param record         - Record to serialize
+   * @param schemaKeyField - Key field in the schema
+   * @return Serialized byte buffer for the record
+   */
+  protected ByteBuffer serializeRecord(final IndexedRecord record, final 
Option<Field> schemaKeyField) {
+    ValidationUtils.checkArgument(record.getSchema() != null, "Unknown schema 
for the record!");
+    return ByteBuffer.wrap(HoodieAvroUtils.indexedRecordToBytes(record));

Review comment:
       What is the benefit of using ByteBuffer.wrap here? We do not perform any 
operations on the returned ByteBuffer but instead call .array() on it to 
retrive the internal byte[]




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