swamirishi commented on code in PR #3606:
URL: https://github.com/apache/ozone/pull/3606#discussion_r925957440
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/SCMCommonPlacementPolicy.java:
##########
@@ -126,7 +127,36 @@ public ConfigurationSource getConf() {
* @throws SCMException SCM exception.
*/
@Override
- public List<DatanodeDetails> chooseDatanodes(
+ public final List<DatanodeDetails> chooseDatanodes(
+ List<DatanodeDetails> excludedNodes,
+ List<DatanodeDetails> favoredNodes,
+ int nodesRequired, long metadataSizeRequired, long dataSizeRequired)
+ throws SCMException {
+// This method calls the chooseDatanodeInternal after fixing
+// the excludeList to get the DatanodeDetails from the node manager.
+// Network Topology requires this info to choose a random node.
+ return chooseDatanodesInternal(
+ Objects.isNull(excludedNodes)
+ ? excludedNodes : excludedNodes.stream()
+ .map(node -> nodeManager
+ .getNodeByUuid(node.getUuidString()))
Review Comment:
Instead of Filtering out. It is better to pass the object. It totally
depends on the implementation if it is gonna use NetworkTopology to choose a
node.
--
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]