public static List < InetSocketAddress > getNNServiceRpcAddresses ( Configuration conf ) throws IOException { // Use default address as fall back String defaultAddress ; try { defaultAddress = NameNode . getDefaultAddress ( conf ) ; } catch ( IllegalArgumentException e ) { defaultAddress = null ; } List < InetSocketAddress > addressList = getAddresses ( conf , defaultAddress , NameNode . DATANODE_PROTOCOL_ADDRESS , FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY ) ; if ( addressList == null ) { throw new IOException ( "Incorrect configuration: namenode address " + NameNode . DATANODE_PROTOCOL_ADDRESS + " or " + FSConstants . DFS_NAMENODE_RPC_ADDRESS_KEY + " is not configured." ) ; } return addressList ; }
Returns list of InetSocketAddresses corresponding to namenodes from the configuration . Note this is to be used by datanodes to get the list of namenode addresses to talk to .