RemoteNameNodeInfo { public static List<RemoteNameNodeInfo> getRemoteNameNodes(Configuration conf) throws IOException { String nsId = DFSUtil.getNamenodeNameServiceId(conf); return getRemoteNameNodes(conf, nsId); } private  RemoteNameNodeInfo(Configuration conf, String nnId, InetSocketAddress ipcAddress,
      URL httpAddress); static List<RemoteNameNodeInfo> getRemoteNameNodes(Configuration conf); static List<RemoteNameNodeInfo> getRemoteNameNodes(Configuration conf, String nsId); InetSocketAddress getIpcAddress(); String getNameNodeID(); URL getHttpAddress(); Configuration getConfiguration(); void setIpcAddress(InetSocketAddress ipc); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testParseMultipleNameNodes() throws Exception { Configuration conf = new Configuration(false); String nameservice = "ns1"; MiniDFSNNTopology topology = new MiniDFSNNTopology() .addNameservice(new MiniDFSNNTopology.NSConf(nameservice) .addNN(new MiniDFSNNTopology.NNConf("nn1").setIpcPort(10001)) .addNN(new MiniDFSNNTopology.NNConf("nn2").setIpcPort(10002)) .addNN(new MiniDFSNNTopology.NNConf("nn3").setIpcPort(10003))); MiniDFSCluster.configureNameNodes(topology, false, conf); conf.set(DFSConfigKeys.DFS_HA_NAMENODE_ID_KEY, "nn1"); List<RemoteNameNodeInfo> nns = RemoteNameNodeInfo.getRemoteNameNodes(conf); List<RemoteNameNodeInfo> nns2 = RemoteNameNodeInfo.getRemoteNameNodes(conf, nameservice); assertEquals(nns, nns2); }