sodonnel commented on code in PR #3606:
URL: https://github.com/apache/ozone/pull/3606#discussion_r925543664


##########
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:
   There are a few tests failing, and I think its because the MockNodeManager 
is not setup correctly to return the nodes when the 
MockNodeManager.getNodeByUuid() is called. However it does highlight a problem, 
in that if the excluded node is not found here, a null will end up in the 
excludedNodes array. I think we need to filter out any that map to null.



-- 
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]

Reply via email to