lokeshj1703 commented on a change in pull request #2756:
URL: https://github.com/apache/ozone/pull/2756#discussion_r765673589



##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/FindTargetGreedy.java
##########
@@ -109,6 +122,7 @@ private void 
setConfiguration(ContainerBalancerConfiguration conf) {
   @Override
   public ContainerMoveSelection findTargetForContainerMove(
       DatanodeDetails source, Set<ContainerID> candidateContainers) {
+    sortTargetForSource(source);

Review comment:
       Sorting would happen every time function is called. I think we can 
optimise for same source.

##########
File path: 
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/FindTargetGreedy.java
##########
@@ -52,30 +57,19 @@
   private NodeManager nodeManager;
   private ContainerBalancerConfiguration config;
   private Double upperLimit;
-  private TreeSet<DatanodeUsageInfo> potentialTargets;
+  private Collection<DatanodeUsageInfo> potentialTargets;
+  private NetworkTopology networkTopology;
 
   public FindTargetGreedy(

Review comment:
       How about we make `FindTargetGreedy` an abstract class and have two 
inherited classes FindTargetByUsage and FindTargetByNetworkTopology?




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