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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -642,37 +643,38 @@ public DiskBalancerInfo getDiskBalancerInfo() {
   }
 
   public long calculateBytesToMove(MutableVolumeSet inputVolumeSet) {
-    long bytesPendingToMove = 0;
-    long totalFreeSpace = 0;
-    long totalCapacity = 0;
-
-    for (HddsVolume volume : 
StorageVolumeUtil.getHddsVolumesList(inputVolumeSet.getVolumesList())) {
-      totalFreeSpace += volume.getCurrentUsage().getAvailable();
-      totalCapacity += volume.getCurrentUsage().getCapacity();
-    }
-
-    if (totalCapacity == 0) {
+    // If there are no available volumes, return 0 bytes to move
+    if (inputVolumeSet.getVolumesList().isEmpty()) {
       return 0;
     }
 
-    double datanodeUtilization = ((double) (totalCapacity - totalFreeSpace)) / 
totalCapacity;
+    double idealUsage = inputVolumeSet.getIdealUsage();

Review Comment:
   Ok
   



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