public static String getInfoServer(
      InetSocketAddress namenode, Configuration conf, boolean isAvatar) {
    String httpAddressDefault = 
        NetUtils.getServerAddress(conf, "dfs.info.bindAddress", 
                                  "dfs.info.port", "dfs.http.address"); 
    String httpAddress = null;
    if(namenode != null) {
      if (!isAvatar) {
        // if non-default namenode, try reverse look up 
        // the nameServiceID if it is available
        String nameServiceId = DFSUtil.getNameServiceIdFromAddress(
            conf, namenode,
            FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY);

        if (nameServiceId != null) {
          httpAddress = conf.get(DFSUtil.getNameServiceIdKey(
              FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY, nameServiceId));
        }
      } else {
        // federated, avatar addresses
        String suffix = "0";
        String nameServiceId = DFSUtil.getNameServiceIdFromAddress(
            conf, namenode,
            FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY + "0");
        if (nameServiceId == null) {
          nameServiceId = DFSUtil.getNameServiceIdFromAddress(
              conf, namenode,
              FSConstants.DFS_NAMENODE_RPC_ADDRESS_KEY + "1");
          suffix = "1";
        }
        if (nameServiceId != null) {
          httpAddress = conf.get(DFSUtil.getNameServiceIdKey(
              FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY + suffix, nameServiceId));
        }
        
        // federated, avatar addresses - ok
        if (httpAddress != null) {
          return httpAddress;
        }
        
        // non-federated, avatar adresses
        httpAddress = getNonFederatedAvatarInfoServer(namenode, "0", conf);
        if (httpAddress != null) {
          return httpAddress;
        }
        httpAddress = getNonFederatedAvatarInfoServer(namenode, "1", conf);     
      }
    }

    // else - Use non-federation, non-avatar configuration
    if (httpAddress == null) {
      httpAddress = conf.get(FSConstants.DFS_NAMENODE_HTTP_ADDRESS_KEY, httpAddressDefault);
    }
    return httpAddress;
  }
public static String getInfoServer ( InetSocketAddress namenode , Configuration conf , boolean isAvatar ) { String httpAddressDefault = NetUtils . getServerAddress ( conf , "dfs.info.bindAddress" , "dfs.info.port" , "dfs.http.address" ) ; String httpAddress = null ; if ( namenode != null ) { if ( ! isAvatar ) { String nameServiceId = DFSUtil . getNameServiceIdFromAddress ( conf , namenode , FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY ) ; if ( nameServiceId != null ) { httpAddress = conf . get ( DFSUtil . getNameServiceIdKey ( FSConstants . DFS_NAMENODE_HTTP_ADDRESS_KEY , nameServiceId ) ) ; } } else { String suffix = "0" ; String nameServiceId = DFSUtil . getNameServiceIdFromAddress ( conf , namenode , FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY + "0" ) ; if ( nameServiceId == null ) { nameServiceId = DFSUtil . getNameServiceIdFromAddress ( conf , namenode , FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY + "1" ) ; suffix = "1" ; } if ( nameServiceId != null ) { httpAddress = conf . get ( DFSUtil . getNameServiceIdKey ( FSConstants . DFS_NAMENODE_HTTP_ADDRESS_KEY + suffix , nameServiceId ) ) ; } if ( httpAddress != null ) { return httpAddress ; } httpAddress = getNonFederatedAvatarInfoServer ( namenode , "0" , conf ) ; if ( httpAddress != null ) { return httpAddress ; } httpAddress = getNonFederatedAvatarInfoServer ( namenode , "1" , conf ) ; } } if ( httpAddress == null ) { httpAddress = conf . get ( FSConstants . DFS_NAMENODE_HTTP_ADDRESS_KEY , httpAddressDefault ) ; } return httpAddress ; }
return server http address from the configuration
@param conf
@param namenode - namenode address
@param isAvatar - whether it's avatar config
@return server http