code: 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;
    }
docs: 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.
  
  Returns namenode address specifically configured for datanodes (using
  service ports), if found. If not, regular RPC address configured for other
  clients is returned.
  
  @param conf configuration
  @return list of InetSocketAddress
  @throws IOException on error