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


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerService.java:
##########
@@ -363,17 +363,19 @@ public BackgroundTaskQueue getTasks() {
   private boolean shouldDelay() {
     // We should wait for next AvailableTime.
     if (Time.monotonicNow() <= nextAvailableTime.get()) {
+      LOG.info("Skipping balancing until nextAvailableTime ({})", 
nextAvailableTime.get());
       return true;
     }
     // Calculate the next AvailableTime based on bandwidth
     long bytesBalanced = balancedBytesInLastWindow.getAndSet(0L);
-
     final int megaByte = 1024 * 1024;
 
     // converting disk bandwidth in byte/millisec
     float bytesPerMillisec = bandwidthInMB * megaByte / 1000f;
-    nextAvailableTime.set(Time.monotonicNow() +
-        ((long) (bytesBalanced / bytesPerMillisec)));
+    long delayInMillisec = (long) (bytesBalanced / bytesPerMillisec);
+    nextAvailableTime.set(Time.monotonicNow() + delayInMillisec);
+    LOG.debug("Bytes balanced: {} MB, Calculated delay: {} ms ({} sec)",

Review Comment:
   ok sure



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