weimingdiit commented on code in PR #9663:
URL: https://github.com/apache/ozone/pull/9663#discussion_r2867305217


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/CompactionService.java:
##########
@@ -134,25 +131,21 @@ private boolean shouldRun() {
     return !suspended.get();
   }
 
+  /**
+   * Compact a specific table asynchronously. This method returns immediately
+   * with a CompletableFuture that completes when the compaction finishes.
+   * This is useful for on-demand compaction requests (e.g., via admin RPC)
+   * where the caller doesn't need to wait for completion.
+   *
+   * @param tableName the name of the table to compact
+   * @return CompletableFuture that completes when compaction finishes
+   */
+  public CompletableFuture<Void> compactTableAsync(String tableName) {
+    return CompactDBUtil.compactTableAsync(omMetadataManager, tableName);
+  }

Review Comment:
   `For on-demand compaction, consider scheduling the work on this 
BackgroundService's executor (serializing with existing compactions) to avoid 
uncontrolled parallel manual compactions and avoid using the common pool` 
   This is a good suggestion, but I think the main goal of this PR is to merge 
CompactionService and CompactDBService. For this improvement, I’d prefer to 
open a separate issue and tackle it as a follow-up optimization.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to