[
https://issues.apache.org/jira/browse/HDFS-16865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17654666#comment-17654666
]
ASF GitHub Bot commented on HDFS-16865:
---------------------------------------
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.
> RBF: The source path is always / after RBF proxied the complete, addBlock and
> getAdditionalDatanode RPC.
> --------------------------------------------------------------------------------------------------------
>
> Key: HDFS-16865
> URL: https://issues.apache.org/jira/browse/HDFS-16865
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: ZanderXu
> Assignee: ZanderXu
> Priority: Major
> Labels: pull-request-available
>
> The source path is always / after RBF proxied the complete, addBlock and
> getAdditionalDatanode RPC.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]