nandakumar131 commented on code in PR #8087:
URL: https://github.com/apache/ozone/pull/8087#discussion_r1996793685


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/SCMNodeManager.java:
##########
@@ -1725,24 +1726,28 @@ public DatanodeDetails getNodeByUuid(UUID uuid) {
    */
   @Override
   public List<DatanodeDetails> getNodesByAddress(String address) {
+    List<DatanodeDetails> allNodes = getAllNodes();
     List<DatanodeDetails> results = new LinkedList<>();
     if (Strings.isNullOrEmpty(address)) {
       LOG.warn("address is null");
       return results;
     }
-    Set<UUID> uuids = dnsToUuidMap.get(address);
-    if (uuids == null) {
+    Set<DatanodeID> datanodeIDS = dnsToDnIdMap.get(address);
+    if (datanodeIDS == null) {
       LOG.debug("Cannot find node for address {}", address);
       return results;
     }
 
-    for (UUID uuid : uuids) {
+    datanodeIDS.forEach(datanodeID -> {
       try {
-        results.add(nodeStateManager.getNode(uuid));
-      } catch (NodeNotFoundException e) {
-        LOG.warn("Cannot find node for uuid {}", uuid);
+        List<DatanodeDetails> datanodeDetails = allNodes.stream().
+            filter(node -> node.getID().getID().equals(datanodeID.getID())).

Review Comment:
   ```suggestion
               filter(node -> node.getID().equals(datanodeID)).
   ```



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