yihua commented on code in PR #12900:
URL: https://github.com/apache/hudi/pull/12900#discussion_r1978384504


##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/FileCreateUtilsLegacy.java:
##########
@@ -149,30 +152,26 @@ public static void createInflightDeltaCommit(String 
basePath, String instantTime
 
   public static void createReplaceCommit(CommitMetadataSerDe 
commitMetadataSerDe, String basePath,
                                          String instantTime, 
HoodieReplaceCommitMetadata metadata) throws IOException {
-    createMetaFile(basePath, instantTime, 
HoodieTimeline.REPLACE_COMMIT_EXTENSION,
-        serializeCommitMetadata(commitMetadataSerDe, metadata).get());
+    createMetaFile(basePath, instantTime, 
HoodieTimeline.REPLACE_COMMIT_EXTENSION, Option.of(metadata));
   }
 
   public static void createRequestedClusterCommit(String basePath, String 
instantTime,
-                                                  
HoodieRequestedReplaceMetadata requestedReplaceMetadata)
-      throws IOException {
-    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_CLUSTERING_COMMIT_EXTENSION,
-        serializeRequestedReplaceMetadata(requestedReplaceMetadata).get());
+                                                  
HoodieRequestedReplaceMetadata requestedReplaceMetadata) throws IOException {
+    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_CLUSTERING_COMMIT_EXTENSION, 
Option.of(requestedReplaceMetadata));
   }
 
   public static void createRequestedCompactionCommit(String basePath, String 
instantTime,
-                                                     HoodieCompactionPlan 
requestedCompactionPlan)
-      throws IOException {
-    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_COMPACTION_EXTENSION,
-        serializeCompactionPlan(requestedCompactionPlan).get());
+                                                     HoodieCompactionPlan 
requestedCompactionPlan) throws IOException {
+    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_COMPACTION_EXTENSION, 
Option.of(requestedCompactionPlan));
   }
 
   public static void createRequestedRollbackFile(String basePath, String 
instantTime, HoodieRollbackPlan plan) throws IOException {
-    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_ROLLBACK_EXTENSION, serializeRollbackPlan(plan).get());
+    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_ROLLBACK_EXTENSION, Option.of(plan));
   }
 
   public static void createRequestedRollbackFile(String basePath, String 
instantTime, byte[] content) throws IOException {
-    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_ROLLBACK_EXTENSION, content);
+    createMetaFile(basePath, instantTime, 
HoodieTimeline.REQUESTED_ROLLBACK_EXTENSION,

Review Comment:
   Would be good to create a follow-up JIRA ticket to track the refactoring of 
test code using byte array for handling metadata.



##########
hudi-common/src/test/java/org/apache/hudi/common/testutils/HoodieTestUtils.java:
##########
@@ -392,6 +393,10 @@ public static StoragePath 
getCompleteInstantPath(HoodieStorage storage, StorageP
     return getCompleteInstantFileInfo(storage, parent, instantTime, 
action).getPath();
   }
 
+  public static <T> byte[] convertMetadataToBytArray(T metadata) {

Review Comment:
   ```suggestion
     public static <T> byte[] convertMetadataToByteArray(T metadata) {
   ```



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