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


##########
hadoop-ozone/cli-admin/src/main/java/org/apache/hadoop/hdds/scm/cli/datanode/DiskBalancerReportSubcommand.java:
##########
@@ -192,7 +192,7 @@ private Map<String, Object> 
toJson(DatanodeDiskBalancerInfoProto report) {
         && report.getDiskBalancerConf().hasThreshold()) {
       double idealUsage = report.getIdealUsage();
       double threshold = report.getDiskBalancerConf().getThreshold();
-      double lt = idealUsage - threshold / 100.0;
+      double lt = Math.max(0.0, idealUsage - threshold / 100.0);
       double ut = idealUsage + threshold / 100.0;

Review Comment:
   @ssulav it can happen. If idealUsage for DN is around 95% then even with 
default threshold of 10%, upper bound can go beyond 100%.
   It's better we restrict upper threshold as well to 100%.



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