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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DiskBalancerManager.java:
##########
@@ -260,11 +260,20 @@ private HddsProtos.DatanodeDiskBalancerInfoProto 
getInfoProto(
         getVolumeDataDensitySumForDatanodeDetails(dn);
     HddsProtos.DiskBalancerRunningStatus runningStatus =
         getRunningStatus(dn);
+
+    DiskBalancerStatus status = statusMap.get(dn);
+    if (status == null) {
+      status = new DiskBalancerStatus(false, new DiskBalancerConfiguration(), 
0, 0);

Review Comment:
   @Gargi-jais11 , please refactor this DiskBalancerStatus, as 
DiskBalancerRunningStatus has three state, not just ture and false, let's try 
changing the DiskBalancerStatus#isRunning  from boolean to 
HddsProtos.DiskBalancerRunningStatus.  
   
   After the refactor,  getRunningStatus() can be simply replaced with 
DiskBalancerStatus#getRunningStatus. 



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