siddhantsangwan commented on code in PR #3455:
URL: https://github.com/apache/ozone/pull/3455#discussion_r891159623


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/AbstractFindTargetGreedy.java:
##########
@@ -162,9 +165,16 @@ private boolean containerMoveSatisfiesPlacementPolicy(
             .filter(datanodeDetails -> !datanodeDetails.equals(source))
             .collect(Collectors.toList());
     replicaList.add(target);
-    ContainerPlacementStatus placementStatus =
-        placementPolicy.validateContainerPlacement(replicaList,
-        containerInfo.getReplicationConfig().getRequiredNodes());
+    ContainerPlacementStatus placementStatus;
+    switch (containerInfo.getReplicationType()) {
+    case EC:
+      placementStatus = ecPlacementPolicy.validateContainerPlacement(
+          replicaList, 
containerInfo.getReplicationConfig().getRequiredNodes());
+      break;
+    default:
+      placementStatus = placementPolicy.validateContainerPlacement(replicaList,
+          containerInfo.getReplicationConfig().getRequiredNodes());
+    }

Review Comment:
   Instead of deciding which policy to use in ContainerBalancer, would it be 
better if we decide this in the SCM or someplace else? That way we won't have 
to keep on adding a new switch case here if more policies are introduced in the 
future.



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