simbadzina commented on code in PR #6208:
URL: https://github.com/apache/hadoop/pull/6208#discussion_r1394785317


##########
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:
   `getFileSystemWithConfiguredFailoverProxyProvider` and 
`getFileSystemWithObserverReadProxyProvider()` share the same configuration, 
beside the proxy provider. You can separate shared config these one into a 
separate function, then just set the proxy provider.



-- 
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]

Reply via email to