ayushtkn commented on code in PR #5200:
URL: https://github.com/apache/hadoop/pull/5200#discussion_r1061936677


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java:
##########
@@ -465,6 +465,24 @@ public void setOwner(String src, String username, String 
groupname)
     }
   }
 
+  /**
+   * Try to get the remote location whose bpId is same with the input bpId 
from the input locations.
+   * @param locations the input RemoteLocations.
+   * @param bpId the input bpId.
+   * @return the remote location whose bpId is same with the input.
+   * @throws IOException
+   */
+  private RemoteLocation getLocationWithBPID(List<RemoteLocation> locations, 
String bpId)
+      throws IOException {
+    String nsId = rpcClient.getNameserviceForBlockPoolId(bpId);
+    for (RemoteLocation l : locations) {
+      if (l.getNameserviceId().equals(nsId)) {
+        return l;
+      }
+    }
+    throw new IOException("Can't found remote locations for the " + bpId);

Review Comment:
   This throwing exception ain't backward compatible.
   Like:
   * Create a file
   * Add some blocks
   * The mount entry gets deleted
   * Call complete to close
   * Earlier: The file would have got successfully closed, but now it will 
throw an exception.



-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to