Gargi-jais11 commented on code in PR #8610:
URL: https://github.com/apache/ozone/pull/8610#discussion_r2143019646


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DiskBalancerManager.java:
##########
@@ -107,7 +108,21 @@ public List<HddsProtos.DatanodeDiskBalancerInfoProto> 
getDiskBalancerStatus(
     List<DatanodeDetails> filterDns = null;
     if (hosts.isPresent() && !hosts.get().isEmpty()) {
       filterDns = NodeUtils.mapHostnamesToDatanodes(nodeManager, hosts.get(),
-          useHostnames);
+          useHostnames).stream()
+          .filter(dn -> {
+            try {
+              NodeStatus nodeStatus = nodeManager.getNodeStatus(dn);
+              if (nodeStatus != NodeStatus.inServiceHealthy()) {
+                LOG.warn("Datanode {} is not in optimal state for disk 
balancing." +
+                    " Operational state: {}", dn.getHostName(), 
nodeStatus.getOperationalState());

Review Comment:
   > Also, do we have test for this command? If not, then I think it's ok to 
merge this, otherwise we can test the prodution code update.
   
   Yes we do have `TestDiskBalancerManager.testDatanodeDiskBalancerStatus()` 
this is to test wether status is displayed for all DN.
   Probably we can update this unit test to also check when a specified host 
status is queried which is not in service then nothing should be displayed.
   I find this will be good. 
   What you think?
   



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