sreejasahithi commented on code in PR #10681:
URL: https://github.com/apache/ozone/pull/10681#discussion_r3576073812


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/ContainerBalancerStatusSubcommand.java:
##########
@@ -60,50 +60,84 @@ public void execute(ScmClient scmClient) throws IOException 
{
     boolean isRunning = response.getIsRunning();
     ContainerBalancerStatusInfoProto balancerStatusInfo = 
response.getContainerBalancerStatusInfo();
     if (isRunning) {
-      Instant startedAtInstant = 
Instant.ofEpochSecond(balancerStatusInfo.getStartedAt());
-      LocalDateTime dateTime =
-          LocalDateTime.ofInstant(startedAtInstant, ZoneId.systemDefault());
       System.out.println("ContainerBalancer is Running.");
+    } else if (response.hasContainerBalancerStatusInfo()) {

Review Comment:
   Upon second thought, I feel this change would not be needed as the STOPPING 
state is an internal signal the balance() loop checks isBalancerRunning() at 
each iteration boundary and immediately exits to STOPPED without any blocking 
wait in between. A CLI status poll would almost never catch that transient 
window. The NOT_STARTED case is already expressed by the absence of 
containerBalancerStatusInfo in the response, and the reason for stopping is 
already carried by stopReason and stopMessage fields. Adding a 
ContainerBalancerRunState enum would require a proto wire change, a server side 
translator update, CLI changes, and backward compatibility handling.



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