[ 
https://issues.apache.org/jira/browse/HDFS-16411?focusedWorklogId=709305&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-709305
 ]

ASF GitHub Bot logged work on HDFS-16411:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Jan/22 20:46
            Start Date: 14/Jan/22 20:46
    Worklog Time Spent: 10m 
      Work Description: goiri commented on a change in pull request #3878:
URL: https://github.com/apache/hadoop/pull/3878#discussion_r785160760



##########
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:
       Most of this is already defined in setRpcServerAddress() and it even 
considers exception, etc.
   I would refactor that function to allow specifying a customized port.
   
   In any case, I would leave the general code as it was, and then after that, 
check if routerId is null,  and then set it to this.




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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 709305)
    Time Spent: 1h 50m  (was: 1h 40m)

> RBF: RouterId is NULL when set dfs.federation.router.rpc.enable=false
> ---------------------------------------------------------------------
>
>                 Key: HDFS-16411
>                 URL: https://issues.apache.org/jira/browse/HDFS-16411
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: rbf
>            Reporter: YulongZ
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HDFS-16411.000.patch, HDFS-16411.001.patch, 
> HDFS-16411.002.patch, HDFS-16411.003.patch, HDFS-16411.004.patch
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> When dfs.federation.router.rpc.enable=false, routerid is null, but 
> RouterHeartbeatService need updateStateStore() with routerId.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to