KeeProMise commented on code in PR #6208:
URL: https://github.com/apache/hadoop/pull/6208#discussion_r1395175336
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterRpcClient.java:
##########
@@ -772,13 +780,22 @@ public static boolean isUnavailableException(IOException
ioe) {
* Check if the cluster of given nameservice id is available.
*
* @param nsId nameservice ID.
+ * @param namenode namenode context.
+ * @param listObserverFirst Observer read case, observer NN will be ranked
first.
* @return true if the cluster with given nameservice id is available.
* @throws IOException if error occurs.
*/
- private boolean isClusterUnAvailable(String nsId) throws IOException {
+ private boolean isClusterUnAvailable(
+ String nsId, FederationNamenodeContext namenode,
+ boolean listObserverFirst) throws IOException {
+ // Use observer and the namenode that causes the exception is an observer,
+ // false is returned so that the observer can be marked as unavailable,so
other observers
+ // or active namenode which is standby in the cache of the router can be
retried.
Review Comment:
Thanks for your advice.
##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/java/org/apache/hadoop/hdfs/server/federation/MiniRouterDFSCluster.java:
##########
@@ -253,6 +253,19 @@ public FileSystem
getFileSystemWithObserverReadProxyProvider() throws IOExceptio
return DistributedFileSystem.get(observerReadConf);
}
+ public FileSystem getFileSystemWithConfiguredFailoverProxyProvider()
throws IOException {
+ conf.set(DFS_NAMESERVICES,
+ conf.get(DFS_NAMESERVICES)+ ",router-service");
+ conf.set(DFS_HA_NAMENODES_KEY_PREFIX + ".router-service", "router1");
+ conf.set(DFS_NAMENODE_RPC_ADDRESS_KEY+ ".router-service.router1",
+ getFileSystemURI().toString());
+ conf.set(HdfsClientConfigKeys.Failover.PROXY_PROVIDER_KEY_PREFIX
+ + "." + "router-service",
ConfiguredFailoverProxyProvider.class.getName());
+ DistributedFileSystem.setDefaultUri(conf, "hdfs://router-service");
+
+ return DistributedFileSystem.get(conf);
+ }
Review Comment:
done.
--
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]