[ 
https://issues.apache.org/jira/browse/HDFS-13480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16474459#comment-16474459
 ] 

Íñigo Goiri commented on HDFS-13480:
------------------------------------

A couple comments for the docu:
* For the example flow: "The Router monitors the local NameNode and its state 
and heartbeats to the State Store."
* For the Router heartbeat: "The Router periodically heartbeats its state to 
the State Store."

For the unit test:
* We could create a method to get the router hearbeat service similar to 
{{getNamenodeHearbeatServices()}}, then you can just do the same check for that.
* This should be refactored with a method like:
{code}
private void assertRouterHeartbeater(boolean expectedRouterHeartbeat, boolean 
expectedNNHeartbeat) {
  final Router router = new Router();
  Configuration baseCfg = new RouterConfigBuilder(conf).rpc().build();
  conf.setBoolean(RBFConfigKeys.DFS_ROUTER_HEARTBEAT_ENABLE, 
expectedRouterHeartbeat);
  conf.setBoolean(RBFConfigKeys.DFS_ROUTER_NAMENODE_HEARTBEAT_ENABLE, 
expectedNNHeartbeat);
  routerHeartbeatService = router.getRouterHearbeatServices();
  if (expectedRouterHeartbeat) {
    assertNotNull(routerHeartbeatService );
  } else {
    asserNull(routerHeartbeatService);
  }
  ...
}
{code}

> RBF: Separate namenodeHeartbeat and routerHeartbeat to different config key
> ---------------------------------------------------------------------------
>
>                 Key: HDFS-13480
>                 URL: https://issues.apache.org/jira/browse/HDFS-13480
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: maobaolong
>            Assignee: maobaolong
>            Priority: Major
>         Attachments: HDFS-13480.001.patch, HDFS-13480.002.patch
>
>
> Now, if i enable the heartbeat.enable, but i do not want to monitor any 
> namenode, i get an ERROR log like:
> {code:java}
> [2018-04-19T14:00:03.057+08:00] [ERROR] 
> federation.router.Router.serviceInit(Router.java 214) [main] : Heartbeat is 
> enabled but there are no namenodes to monitor
> {code}
> and if i disable the heartbeat.enable, we cannot get any mounttable update, 
> because the following logic in Router.java:
> {code:java}
> if (conf.getBoolean(
>         RBFConfigKeys.DFS_ROUTER_HEARTBEAT_ENABLE,
>         RBFConfigKeys.DFS_ROUTER_HEARTBEAT_ENABLE_DEFAULT)) {
>       // Create status updater for each monitored Namenode
>       this.namenodeHeartbeatServices = createNamenodeHeartbeatServices();
>       for (NamenodeHeartbeatService hearbeatService :
>           this.namenodeHeartbeatServices) {
>         addService(hearbeatService);
>       }
>       if (this.namenodeHeartbeatServices.isEmpty()) {
>         LOG.error("Heartbeat is enabled but there are no namenodes to 
> monitor");
>       }
>       // Periodically update the router state
>       this.routerHeartbeatService = new RouterHeartbeatService(this);
>       addService(this.routerHeartbeatService);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to