code: public static InetSocketAddress getNameNodeAddress(Configuration conf) {
      InetSocketAddress addr = null;
      addr = NameNode.getDNProtocolAddress(conf);
      if (addr != null) {
        return addr;
      }
      return NameNode.getClientProtocolAddress(conf);
    }
docs: This method returns the address namenode uses to communicate with
  datanodes. If this address is not configured the default NameNode
  address is used, as it is running only one RPC server.
  If it is running multiple servers this address cannot be used by clients!!
  
  Note: If DataNodeProtocolAddress isn't configured,  we fallback to
  ClientProtocolAddress.
  @param conf