KeeProMise commented on code in PR #5990:
URL: https://github.com/apache/hadoop/pull/5990#discussion_r1314749829
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -599,10 +599,8 @@ public Object invokeMethod(
}
LOG.error("Cannot get available namenode for {} {} error: {}",
nsId, rpcAddress, ioe.getMessage());
- if (this.namenodeResolver != null) {
- this.namenodeResolver.rotateCache(nsId, namenode,
shouldUseObserver);
- LOG.info("Rotate cache of pair: <ns: {}, observer use: {}>", nsId,
shouldUseObserver);
- }
+ // Rotate cache so that client can retry the next namenode in the
cache
+ this.namenodeResolver.rotateCache(nsId, namenode, shouldUseObserver);
Review Comment:
There is no need to judge whether the namenodeResolver is empty, because the
namenodeResolver is not null when the router is initialized
in Router.java line:178
``` java
this.namenodeResolver = newActiveNamenodeResolver(
this.conf, this.stateStore);
if (this.namenodeResolver == null) {
throw new IOException("Cannot find namenode resolver.");
}
```
--
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]