slfan1989 commented on code in PR #10355:
URL: https://github.com/apache/ozone/pull/10355#discussion_r3310833960


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerVolumeCalculation.java:
##########
@@ -167,13 +166,15 @@ public static final class VolumeFixedUsage {
     private final HddsVolume volume;
     private final SpaceUsageSource.Fixed usage;
     private final long effectiveUsed;
-    private final Double utilization;
+    private final double utilization;
 
     private VolumeFixedUsage(HddsVolume volume, long delta) {
       this.volume = volume;
       this.usage = volume.getCurrentUsage();
       this.effectiveUsed = computeEffectiveUsage(usage, 
volume.getCommittedBytes(), delta);
-      this.utilization = usage.getCapacity() > 0 ? computeUtilization(usage, 
volume.getCommittedBytes(), delta) : null;
+      this.utilization = usage.getCapacity() > 0
+          ? computeUtilization(usage, volume.getCommittedBytes(), delta)
+          : 1.0;

Review Comment:
   Thanks for the clarification. Updated the zero-capacity volume utilization 
from 1.0 to 0.0, and adjusted the related tests accordingly.



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