sumitagrawl commented on code in PR #6558:
URL: https://github.com/apache/ozone/pull/6558#discussion_r1601563064
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/algorithms/SCMContainerPlacementRackAware.java:
##########
@@ -124,11 +126,11 @@ protected List<DatanodeDetails> chooseDatanodesInternal(
int datanodeCount = networkTopology.getNumOfLeafNode(NetConstants.ROOT);
int excludedNodesCount = excludedNodes == null ? 0 : excludedNodes.size();
int usedNodesCount = usedNodes == null ? 0 : usedNodes.size();
- if (datanodeCount < nodesRequired + excludedNodesCount + usedNodesCount) {
- throw new SCMException("No enough datanodes to choose. " +
- "TotalNode = " + datanodeCount + " RequiredNode = " + nodesRequired +
- " ExcludedNode = " + excludedNodesCount +
- " UsedNode = " + usedNodesCount, null);
+ Set<DatanodeDetails> unavailableNodes =
JavaUtils.unionOfCollections(usedNodes, excludedNodes);
Review Comment:
unavailableNodes is not used, just its count. so also can get
unavailableCount = usedNodesCount + excludedNodesCount
currently, unionOfCollection seems un-necessary for this case
--
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]