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



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java
##########
@@ -308,6 +308,22 @@ protected void serviceInit(Configuration configuration) 
throws Exception {
     }
   }
 
+  private void checkRouterId() {

Review comment:
       Add a javadoc saying that we set the router if not set to prevent XYZ.

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java
##########
@@ -308,6 +308,22 @@ protected void serviceInit(Configuration configuration) 
throws Exception {
     }
   }
 
+  private void checkRouterId() {
+    if (this.routerId == null) {
+      try {
+        String hostname = InetAddress.getLocalHost().getHostName();

Review comment:
       You could do:
   ```
   setRpcServerAddress(confRpcAddress);
   ```

##########
File path: 
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/Router.java
##########
@@ -195,7 +195,7 @@ protected void serviceInit(Configuration configuration) 
throws Exception {
       addService(this.rpcServer);
       this.setRpcServerAddress(rpcServer.getRpcAddress());
     }
-
+    checkRouterId();

Review comment:
       Add breaklines before and after.




-- 
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: common-issues-unsubscr...@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to