jojochuang commented on PR #10865:
URL: https://github.com/apache/ozone/pull/10865#issuecomment-5096185457
This is fine. A little rewrite can make the code more self explanatory. The
pipeline choosing algorithm could end up becoming too complex to maintain.
case THREE:
dns = chooseThreeFactorDatanodes(excludedNodes, favoredNodes);
break;
private List<DatanodeDetails> chooseThreeFactorDatanodes(
List<DatanodeDetails> excludedNodes, List<DatanodeDetails>
favoredNodes) throws IOException {
List<DatanodeDetails> strictExcluded = new ArrayList<>(excludedNodes);
strictExcluded.addAll(filterNodes(true));
try {
return placementPolicy.chooseDatanodes(
strictExcluded, favoredNodes, 3, minRatisVolumeSizeBytes,
containerSizeBytes);
} catch (SCMException e) {
List<DatanodeDetails> relaxedExcluded = new
ArrayList<>(excludedNodes);
relaxedExcluded.addAll(filterNodes(false));
return placementPolicy.chooseDatanodes(
relaxedExcluded, favoredNodes, 3, minRatisVolumeSizeBytes,
containerSizeBytes);
}
}
--
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]