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


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerReportSubcommand.java:
##########
@@ -108,8 +108,8 @@ private String 
generateReport(List<DatanodeDiskBalancerInfoProto> protos) {
           && p.getDiskBalancerConf().hasThreshold()) {
         double idealUsage = p.getIdealUsage();
         double threshold = p.getDiskBalancerConf().getThreshold();
-        double lt = idealUsage - threshold / 100.0;
-        double ut = idealUsage + threshold / 100.0;
+        double lt = Math.max(0.0, idealUsage - threshold / 100.0);

Review Comment:
   The clip in the report is only so **ThresholdRange** stays within [0, 1] for 
display so the user don't confuse with -ve or greater than 1 threshold range.
   `**DefaultContainerChoosingPolicy**` should keep unclipped **idealUsage ± 
threshold/100**: 
   **utilization will always be in range of [0, 1]**, so a negative lower bound 
or an upper bound above 1 effectively relaxes that side of the check, which 
matches “within threshold” when ideal is near 0 or 1. Clipping there would 
change stop/move behavior at 0%/100% volumes.
   
   
   
   



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