adoroszlai commented on code in PR #10355:
URL: https://github.com/apache/ozone/pull/10355#discussion_r3296261187
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -743,13 +743,15 @@ public static List<VolumeReportProto>
buildVolumeReportProto(List<VolumeFixedUsa
List<VolumeReportProto> result = new ArrayList<>();
for (VolumeFixedUsage v : volumeSet) {
HddsVolume volume = v.getVolume();
+ double utilization = v.getUsage().getCapacity() == 0
+ ? 0.0 : v.getUtilization();
Review Comment:
I think `getUtilization` should return `1.0` (for 100%) for `capacity=0`,
not `null`.
Alternatively, it could be `NaN`, but then it needs to be handled as special
case just like `null`.
`VolumeFixedUsage.utilization` should be `double`, not `Double` in either
case.
--
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]