JacksonYao287 commented on a change in pull request #2676:
URL: https://github.com/apache/ozone/pull/2676#discussion_r719314416



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DatanodeUsageInfo.java
##########
@@ -60,25 +61,27 @@ private static int compareByUtilization(DatanodeUsageInfo 
first,
     if (first.equals(second)) {
       return 0;
     }
-    return Double.compare(first.calculateUtilization(),
-        second.calculateUtilization());
+    return Double.compare(first.calculateUtilization(0),
+        second.calculateUtilization(0));
   }
 
   /**
-   * Calculates utilization of a datanode. Utilization of a datanode is defined
-   * as its used space divided by its capacity. Here, we prefer calculating
+   * Calculates utilization of a datanode after adding a specified size.
+   * Utilization of a datanode is defined as its used space divided
+   * by its capacity. Here, we prefer calculating
    * used space as (capacity - remaining), instead of using
    * {@link SCMNodeStat#getScmUsed()} (see HDDS-5728).
    *
+   * @param plusSize the increased size
    * @return (capacity - remaining) / capacity of this datanode
    */
-  public double calculateUtilization() {
-    double capacity = scmNodeStat.getCapacity().get();
+  public double calculateUtilization(long plusSize) {

Review comment:
       sure, i will do this 




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