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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -1092,28 +1092,20 @@ public HoodieWriteMetadata<O> compact(String 
compactionInstantTime) {
     if (shouldDelegateToTableServiceManager(config, ActionType.compaction)) {
       throw new UnsupportedOperationException("Compaction should be delegated 
to table service manager instead of direct run.");
     }
-    return compact(compactionInstantTime, config.shouldAutoCommit());
-  }
-
-  /**
-   * Commit a compaction operation. Allow passing additional meta-data to be 
stored in commit instant file.
-   *
-   * @param compactionInstantTime Compaction Instant Time
-   * @param metadata All the metadata that gets stored along with a commit
-   * @param extraMetadata Extra Metadata to be stored
-   */
-  public void commitCompaction(String compactionInstantTime, 
HoodieCommitMetadata metadata,
-                               Option<Map<String, String>> extraMetadata) {
-    tableServiceClient.commitCompaction(compactionInstantTime, metadata, 
extraMetadata);
+    return compact(compactionInstantTime, false);

Review Comment:
   - `TestSavepointRestoreMergeOnRead#testCleaningDeltaCommits`
   ```
           if (i == 1) {
             Option<String> compactionInstant = 
client.scheduleCompaction(Option.empty());
             assertTrue(compactionInstant.isPresent(), "A compaction plan 
should be scheduled");
             compactionCommit = compactionInstant.get();
             client.compact(compactionInstant.get());
           }
   ```
   `#testCleaningCompletedRollback`
   ```
   // update to generate log files, then a valid compaction plan can be 
scheduled
         upsertBatch(client, baseRecordsToUpdate);
         Option<String> compactionInstant = 
client.scheduleCompaction(Option.empty());
         assertTrue(compactionInstant.isPresent(), "A compaction plan should be 
scheduled");
         client.compact(compactionInstant.get());
         savepointCommit = compactionInstant.get();
         client.savepoint("user1", "Savepoint for 3td commit");
   ```
   ```
   private void compactWithoutCommit(String compactionInstantTime) {
       HoodieWriteConfig hoodieWriteConfig = 
getConfigBuilder(HoodieFailedWritesCleaningPolicy.LAZY)
           .withRollbackUsingMarkers(true)
           .build();
   
       try (SparkRDDWriteClient client = 
getHoodieWriteClient(hoodieWriteConfig)) {
         JavaRDD<WriteStatus> statuses = (JavaRDD<WriteStatus>) 
client.compact(compactionInstantTime).getWriteStatuses();
         assertNoWriteErrors(statuses.collect());
       }
     }
   ```



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