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


##########
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)
+          : 0.0;

Review Comment:
   Good question. 0.0 is only used as a safe value for zero-capacity volumes to 
avoid reporting them as over-utilized. Such volumes should not become 
DiskBalancer candidates because DefaultContainerChoosingPolicy filters out 
volumes with capacity <= 0 before selecting source/destination volumes, and 
destination selection also requires positive usable space. 



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