code: static InetSocketAddress getNameNodeAddress(Configuration conf,
                                                        String cname, String rpcKey, String cname2) {
      String fs = conf.get(cname);
      String fs1 = conf.get(rpcKey);
      String fs2 = conf.get(cname2);
      Configuration newconf = new Configuration(conf);
      newconf.set("fs.default.name", fs);
      if (fs1 != null) {
        newconf.set(DFS_NAMENODE_RPC_ADDRESS_KEY, fs1);
      }
      if (fs2 != null) {
        newconf.set("dfs.namenode.dn-address", fs2);
      }
      return DataNode.getNameNodeAddress(newconf);
    }
docs: Returns the IP address of the namenode