xiaoyuyao commented on a change in pull request #389: HDDS-2534. scmcli container delete not working URL: https://github.com/apache/hadoop-ozone/pull/389#discussion_r366605305
########## File path: hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/SCMContainerManager.java ########## @@ -282,6 +290,12 @@ public ContainerInfo allocateContainer(final ReplicationType type, public void deleteContainer(ContainerID containerID) throws IOException { lock.lock(); try { + Set<ContainerReplica> replicas = + containerStateManager.getContainerReplicas(containerID); + for(ContainerReplica replica : replicas){ + nodeManager.removeContainers(replica.getDatanodeDetails(), Stream.of( Review comment: Can we create the set of containerID outside the loop with a simpler Java APIs: Set<ContainerID> containerIdSet = Collections.singleton(containerID); replias.forEach(replica->replica.removeContainers(replica.getDatanodeDetails(), containerIdSet)); ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org