You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/06/28 12:15:57 UTC

[GitHub] [ozone] adoroszlai commented on a diff in pull request #3547: HDDS-6940. EC: Skip the EC container for balancer

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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org