NickyYe commented on a change in pull request #2080:
URL: https://github.com/apache/hadoop/pull/2080#discussion_r443029430



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterWebHdfsMethods.java
##########
@@ -502,12 +479,27 @@ private DatanodeInfo chooseDatanode(final Router router,
         final LocatedBlocks locations = cp.getBlockLocations(path, offset, 1);
         final int count = locations.locatedBlockCount();
         if (count > 0) {
+          if (excludeDatanodes != null) {
+            Collection<String> collection =
+                getTrimmedStringCollection(excludeDatanodes);
+            dns = getDatanodeReport(router);
+            for (DatanodeInfo dn : dns) {
+              if (collection.contains(dn.getName())) {
+                excludes.add(dn);
+              }
+            }
+          }
+          
           LocatedBlock location0 = locations.get(0);
           return bestNode(location0.getLocations(), excludes);
         }
       }
     }
 
+    if (dns == null) {

Review comment:
       Thanks. I follow the previous logic now with cached DN report




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

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