yulongz commented on a change in pull request #3878:
URL: https://github.com/apache/hadoop/pull/3878#discussion_r785594583



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java
##########
@@ -386,6 +380,26 @@ public void run() {
   // RPC Server
   /////////////////////////////////////////////////////////
 
+  private void setRpcServer() throws IOException {
+    if (conf.getBoolean(
+            RBFConfigKeys.DFS_ROUTER_RPC_ENABLE,
+            RBFConfigKeys.DFS_ROUTER_RPC_ENABLE_DEFAULT)) {
+      // Create RPC server
+      this.rpcServer = createRpcServer();
+      addService(this.rpcServer);
+      this.setRpcServerAddress(rpcServer.getRpcAddress());
+    } else {
+      InetSocketAddress confRpcAddress = conf.getSocketAddr(
+              RBFConfigKeys.DFS_ROUTER_RPC_BIND_HOST_KEY,
+              RBFConfigKeys.DFS_ROUTER_RPC_ADDRESS_KEY,
+              RBFConfigKeys.DFS_ROUTER_RPC_ADDRESS_DEFAULT,
+              RBFConfigKeys.DFS_ROUTER_RPC_PORT_DEFAULT);
+
+      String hostname = InetAddress.getLocalHost().getHostName();

Review comment:
       Thanks for your advice. The method setRpcServerAddress() is only called 
when rpc.enable is true. Maybe we can add a new method after that and check 
routerid.




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