goiri commented on code in PR #5262:
URL: https://github.com/apache/hadoop/pull/5262#discussion_r1059897696
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -865,18 +867,24 @@ public Object invokeSingleBlockPool(final String bpId,
RemoteMethod method)
*
* @param nsId Target namespace for the method.
* @param method The remote method and parameters to invoke.
+ * @param src file path, pass "" if not have.
* @return The result of invoking the method.
* @throws IOException If the invoke generated an error.
*/
- public Object invokeSingle(final String nsId, RemoteMethod method)
+ public Object invokeSingle(final String nsId, RemoteMethod method, String
src)
throws IOException {
UserGroupInformation ugi = RouterRpcServer.getRemoteUser();
RouterRpcFairnessPolicyController controller =
getRouterRpcFairnessPolicyController();
acquirePermit(nsId, ugi, method, controller);
try {
boolean isObserverRead = isObserverReadEligible(nsId,
method.getMethod());
List<? extends FederationNamenodeContext> nns =
getOrderedNamenodes(nsId, isObserverRead);
- RemoteLocationContext loc = new RemoteLocation(nsId, "/", "/");
+ RemoteLocationContext loc;
+ if (org.apache.commons.lang3.StringUtils.isBlank(src)) {
+ loc = new RemoteLocation(nsId, "/", "/");
+ } else {
+ loc = new RemoteLocation(nsId, src, "/");
Review Comment:
Couldn't we pass this in the Remote Method?
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -865,18 +867,24 @@ public Object invokeSingleBlockPool(final String bpId,
RemoteMethod method)
*
* @param nsId Target namespace for the method.
* @param method The remote method and parameters to invoke.
+ * @param src file path, pass "" if not have.
* @return The result of invoking the method.
* @throws IOException If the invoke generated an error.
*/
- public Object invokeSingle(final String nsId, RemoteMethod method)
+ public Object invokeSingle(final String nsId, RemoteMethod method, String
src)
throws IOException {
UserGroupInformation ugi = RouterRpcServer.getRemoteUser();
RouterRpcFairnessPolicyController controller =
getRouterRpcFairnessPolicyController();
acquirePermit(nsId, ugi, method, controller);
try {
boolean isObserverRead = isObserverReadEligible(nsId,
method.getMethod());
List<? extends FederationNamenodeContext> nns =
getOrderedNamenodes(nsId, isObserverRead);
- RemoteLocationContext loc = new RemoteLocation(nsId, "/", "/");
+ RemoteLocationContext loc;
+ if (org.apache.commons.lang3.StringUtils.isBlank(src)) {
Review Comment:
Why don't we use null as the default instead of blank?
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcServer.java:
##########
@@ -687,7 +687,7 @@ <T> T invokeAtAvailableNs(RemoteMethod method, Class<T>
clazz)
// If default Ns is present return result from that namespace.
if (!nsId.isEmpty()) {
try {
- return rpcClient.invokeSingle(nsId, method, clazz);
+ return rpcClient.invokeSingle(nsId, method, clazz, "");
Review Comment:
Can we add an actual test?
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -865,18 +867,24 @@ public Object invokeSingleBlockPool(final String bpId,
RemoteMethod method)
*
* @param nsId Target namespace for the method.
* @param method The remote method and parameters to invoke.
+ * @param src file path, pass "" if not have.
* @return The result of invoking the method.
* @throws IOException If the invoke generated an error.
*/
- public Object invokeSingle(final String nsId, RemoteMethod method)
+ public Object invokeSingle(final String nsId, RemoteMethod method, String
src)
Review Comment:
We should keep the old signature which sets it to "".
--
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]