huangzhaobo99 commented on code in PR #7120:
URL: https://github.com/apache/hadoop/pull/7120#discussion_r1807386411
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/balancer/Balancer.java:
##########
@@ -456,13 +460,20 @@ private long init(List<DatanodeStorageReport> reports) {
sortOverUtilized(overUtilizedPercentage);
}
+ // Limit the maximum number of overUtilized datanodes
+ // If excludedOverUtilizedNum is greater than 0, The overUtilized nodes
num is limited
+ int excludedOverUtilizedNum = Math.max(overUtilized.size() -
limitOverUtilizedNum, 0);
+ if (excludedOverUtilizedNum > 0) {
+ limitOverUtilizedNum();
+ }
+
logUtilizationCollections();
metrics.setNumOfOverUtilizedNodes(overUtilized.size());
metrics.setNumOfUnderUtilizedNodes(underUtilized.size());
-
- Preconditions.checkState(dispatcher.getStorageGroupMap().size()
- == overUtilized.size() + underUtilized.size() + aboveAvgUtilized.size()
- + belowAvgUtilized.size(),
+
Review Comment:
Sorry, IDEA automatically removes spaces, resubmit again.
--
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]