private static boolean registerClientProtocolAddress(AvatarZooKeeperClient zk,
      Configuration originalConf, Configuration conf, boolean toOverwrite)
      throws UnsupportedEncodingException, IOException {
    LOG.info("Updating Client Address information in ZooKeeper");
    InetSocketAddress addr = NameNode.getClientProtocolAddress(conf);
    if (addr == null) {
      LOG.error(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY
          + " for primary service is not defined");
      return true;
    }
    InetSocketAddress defaultAddr = NameNode.getClientProtocolAddress(originalConf);
    if (defaultAddr == null) {
      LOG.error(FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY
          + " for default service is not defined");
      return true;
    }
    registerSocketAddress(zk,
        originalConf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY),
        conf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY), toOverwrite);
    /** TODO later: need to handle alias leave it as it is now */
    registerAliases(zk, conf, FSConstants.FS_NAMENODE_ALIASES,
        conf.get(NameNode.DFS_NAMENODE_RPC_ADDRESS_KEY), toOverwrite);
    return false;
  }
private static boolean registerClientProtocolAddress ( AvatarZooKeeperClient zk , Configuration originalConf , Configuration conf , boolean toOverwrite ) throws UnsupportedEncodingException , IOException { LOG . info ( "Updating Client Address information in ZooKeeper" ) ; InetSocketAddress addr = NameNode . getClientProtocolAddress ( conf ) ; if ( addr == null ) { LOG . error ( FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY + " for primary service is not defined" ) ; return true ; } InetSocketAddress defaultAddr = NameNode . getClientProtocolAddress ( originalConf ) ; if ( defaultAddr == null ) { LOG . error ( FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY + " for default service is not defined" ) ; return true ; } registerSocketAddress ( zk , originalConf . get ( NameNode . DFS_NAMENODE_RPC_ADDRESS_KEY ) , conf . get ( NameNode . DFS_NAMENODE_RPC_ADDRESS_KEY ) , toOverwrite ) ; registerAliases ( zk , conf , FSConstants . FS_NAMENODE_ALIASES , conf . get ( NameNode . DFS_NAMENODE_RPC_ADDRESS_KEY ) , toOverwrite ) ; return false ; }
Registers namenode's address in zookeeper