ChenSammi commented on code in PR #9426:
URL: https://github.com/apache/ozone/pull/9426#discussion_r2605469288


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyLifecycleService.java:
##########
@@ -219,12 +221,26 @@ public void resume() {
     suspended.set(false);
   }
 
+  public void setServiceEnabled(boolean enabled) {
+    this.isServiceEnabled.set(enabled);
+    LOG.info("KeyLifecycleService is {}", enabled ? "enabled" : "disabled");
+  }
+
   @Override
   public void shutdown() {
     super.shutdown();
     KeyLifecycleServiceMetrics.unregister();
   }
 
+  public GetLifecycleServiceStatusResponse status() {
+    Set<String> runningBuckets = new HashSet<>(inFlight.keySet());
+    return GetLifecycleServiceStatusResponse.newBuilder()
+        .setIsRunning(!runningBuckets.isEmpty())
+        .setIsEnabled(isServiceEnabled.get())

Review Comment:
   Can we combine the IsRunning and IsEnabled to one state.  If IsRuning is the 
result of whether there is bucket task running or not, this info is already 
covered by RunningBuckets fields. 



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