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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/BaseHoodieWriteClient.java:
##########
@@ -1134,42 +1128,34 @@ public boolean scheduleLogCompactionAtInstant(String 
instantTime, Option<Map<Str
 
   /**
    * Performs Log Compaction for the workload stored in instant-time.
+   * By default log compaction may not complete. Callers are expected to call 
{@link #commitCompaction(String, HoodieWriteMetadata, Option)}.
+   * If callers prefer to commit the log compaction, recommendation is to use 
{@link #logCompact(String, boolean)} by setting the second arg to true.
    *
    * @param logCompactionInstantTime Log Compaction Instant Time
    * @return Collection of WriteStatus to inspect errors and counts
    */
   public HoodieWriteMetadata<O> logCompact(String logCompactionInstantTime) {
-    return logCompact(logCompactionInstantTime, config.shouldAutoCommit());
-  }
-
-  /**
-   * Commit a log compaction operation. Allow passing additional meta-data to 
be stored in commit instant file.
-   *
-   * @param logCompactionInstantTime Log Compaction Instant Time
-   * @param metadata All the metadata that gets stored along with a commit
-   * @param extraMetadata Extra Metadata to be stored
-   */
-  public void commitLogCompaction(String logCompactionInstantTime, 
HoodieCommitMetadata metadata,
-                                  Option<Map<String, String>> extraMetadata) {
-    HoodieTable table = createTable(config);
-    extraMetadata.ifPresent(m -> m.forEach(metadata::addMetadata));
-    completeLogCompaction(metadata, table, logCompactionInstantTime);
+    return logCompact(logCompactionInstantTime, false);
   }
 
   /**
    * Commit Log Compaction and track metrics.
-   */
+   **/
   protected void completeLogCompaction(HoodieCommitMetadata metadata, 
HoodieTable table, String logCompactionCommitTime) {
     tableServiceClient.completeLogCompaction(metadata, table, 
logCompactionCommitTime);
   }
 
+  public void completeLogCompaction(String compactionInstantTime, 
HoodieWriteMetadata<O> compactionWriteMetadata, Option<HoodieTable> tableOpt) {

Review Comment:
   Fixed it



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