JacksonYao287 commented on a change in pull request #2808:
URL: https://github.com/apache/ozone/pull/2808#discussion_r752155463
##########
File path:
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/FindTargetGreedy.java
##########
@@ -60,17 +61,27 @@ public FindTargetGreedy(
this.containerManager = containerManager;
this.placementPolicy = placementPolicy;
this.nodeManager = nodeManager;
+
+ potentialTargets = new TreeSet<>((a, b) -> {
+ double currentUsageOfA = a.calculateUtilization(
+ sizeEnteringNode.get(a.getDatanodeDetails()));
+ double currentUsageOfB = b.calculateUtilization(
+ sizeEnteringNode.get(b.getDatanodeDetails()));
+ return Double.compare(currentUsageOfA, currentUsageOfB);
Review comment:
good point , thanks for pointing out 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]