devmadhuu commented on code in PR #8856:
URL: https://github.com/apache/ozone/pull/8856#discussion_r2240379849


##########
hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/ReconUtils.java:
##########
@@ -111,6 +109,43 @@ public class ReconUtils {
   public ReconUtils() {
   }
 
+  /**
+   * Get the current rebuild state of NSSummary tree.
+   * Delegates to NSSummaryTask's unified control mechanism.
+   * 
+   * @return current RebuildState from NSSummaryTask
+   */
+  public static org.apache.hadoop.ozone.recon.tasks.NSSummaryTask.RebuildState 
getNSSummaryRebuildState() {
+    return org.apache.hadoop.ozone.recon.tasks.NSSummaryTask.getRebuildState();
+  }
+
+  /**
+   * Convenience method to trigger asynchronous NSSummary tree rebuild.
+   * Uses the unified control mechanism in NSSummaryTask.
+   * 
+   * @param reconNamespaceSummaryManager The namespace summary manager
+   * @param omMetadataManager The OM metadata manager
+   * @return true if rebuild was triggered successfully, false otherwise
+   */
+  public static boolean triggerAsyncNSSummaryRebuild(
+      ReconNamespaceSummaryManager reconNamespaceSummaryManager,
+      ReconOMMetadataManager omMetadataManager) {
+    
+    // Submit rebuild task to single thread executor for async execution
+    NSSUMMARY_REBUILD_EXECUTOR.submit(() -> {
+      try {
+        // This will go through NSSummaryTask's unified control mechanism
+        reconNamespaceSummaryManager.rebuildNSSummaryTree(omMetadataManager);
+        log.info("Async NSSummary tree rebuild completed successfully.");
+      } catch (Exception e) {
+        log.error("Async NSSummary tree rebuild failed.", e);
+      }
+    });
+    
+    log.info("Async NSSummary tree rebuild triggered successfully.");
+    return true;

Review Comment:
   I don't think so, we are using this returned value except the test case and 
mostly for assertion of submission to executor, but not the actual state of 
thread.



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to