adoroszlai commented on code in PR #3547:
URL: https://github.com/apache/ozone/pull/3547#discussion_r908403439


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java:
##########
@@ -136,6 +140,19 @@ public NavigableSet<ContainerID> getCandidateContainers(
     });
 
     containerIDSet.removeIf(this::isContainerReplicatingOrDeleting);
+
+    // remove EC containers
+    containerIDSet.removeIf(containerID -> {
+      try {

Review Comment:
   I agree with @myskov.  What's more, we could merge these conditions that 
require a container lookup.  Something like this:
   
   ```
       // single removeIf
       containerIDSet.removeIf(this::shouldBeExcluded);
       ...
     }
   
     boolean shouldBeExcluded(ContainerID id) {
       ContainerInfo container;
       try {
         container = containerManager.getContainer(id);
       } catch (ContainerNotFoundException e) {
         LOG.warn(...);
         return true;
       }
   
       return isClosed(container) || ... || isECContainer(container);
     }
   ```



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