KeeProMise commented on code in PR #6991:
URL: https://github.com/apache/hadoop/pull/6991#discussion_r1741742608


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/resolver/order/AvailableSpaceResolver.java:
##########
@@ -118,6 +121,20 @@ protected String chooseFirstNamespace(String path, 
PathLocation loc) {
         getSubclusterMapping();
     List<SubclusterAvailableSpace> subclusterList = new LinkedList<>(
         subclusterInfo.values());
+
+    if (loc != null && loc.getDestinations() != null) {
+        Set<String> locSet = new HashSet<String>();
+        for (RemoteLocation dest : loc.getDestinations()) {
+            locSet.add(dest.getNameserviceId());
+        }
+        List<SubclusterAvailableSpace> filteredSubclusterList = new 
LinkedList<>();
+        for (SubclusterAvailableSpace cluster : subclusterList) {
+            if (locSet.contains(cluster.getNameserviceId())) {
+                filteredSubclusterList.add(cluster);
+            }
+        }
+        subclusterList = filteredSubclusterList;

Review Comment:
   You can change the code indentation.



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