void printMap(Map<String, Map<String, InetSocketAddress>> map) { StringBuilder buffer = new StringBuilder(); List<ConfiguredNNAddress> cnns = DFSUtil.flattenAddressMap(map); for (ConfiguredNNAddress cnn : cnns) { InetSocketAddress address = cnn.getAddress(); if (buffer.length() > 0) { buffer.append(" "); } buffer.append(address.getHostName()); } printOut(buffer.toString()); }
@Override public int doWorkInternal(GetConf tool, String []args) throws IOException { Configuration config = tool.getConf(); List<ConfiguredNNAddress> cnnlist = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddressesForCluster(config)); if (!cnnlist.isEmpty()) { for (ConfiguredNNAddress cnn : cnnlist) { InetSocketAddress rpc = cnn.getAddress(); tool.printOut(rpc.getHostName()+":"+rpc.getPort()); } return 0; } tool.printError("Did not get namenode service rpc addresses."); return -1; } }
void printMap(Map<String, Map<String, InetSocketAddress>> map) { StringBuilder buffer = new StringBuilder(); List<ConfiguredNNAddress> cnns = DFSUtil.flattenAddressMap(map); for (ConfiguredNNAddress cnn : cnns) { InetSocketAddress address = cnn.getAddress(); if (buffer.length() > 0) { buffer.append(" "); } buffer.append(address.getHostName()); } printOut(buffer.toString()); }
void printMap(Map<String, Map<String, InetSocketAddress>> map) { StringBuilder buffer = new StringBuilder(); List<ConfiguredNNAddress> cnns = DFSUtil.flattenAddressMap(map); for (ConfiguredNNAddress cnn : cnns) { InetSocketAddress address = cnn.getAddress(); if (buffer.length() > 0) { buffer.append(" "); } buffer.append(address.getHostName()); } printOut(buffer.toString()); }
@Override public int doWorkInternal(GetConf tool, String []args) throws IOException { Configuration config = tool.getConf(); List<ConfiguredNNAddress> cnnlist = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddressesForCluster(config)); if (!cnnlist.isEmpty()) { for (ConfiguredNNAddress cnn : cnnlist) { InetSocketAddress rpc = cnn.getAddress(); tool.printOut(rpc.getHostName()+":"+rpc.getPort()); } return 0; } tool.printError("Did not get namenode service rpc addresses."); return -1; } }
@Override public int doWorkInternal(GetConf tool, String []args) throws IOException { Configuration config = tool.getConf(); List<ConfiguredNNAddress> cnnlist = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddressesForCluster(config)); if (!cnnlist.isEmpty()) { for (ConfiguredNNAddress cnn : cnnlist) { InetSocketAddress rpc = cnn.getAddress(); tool.printOut(rpc.getHostName()+":"+rpc.getPort()); } return 0; } tool.printError("Did not get namenode service rpc addresses."); return -1; } }
List<ConfiguredNNAddress> cnns = null; try { cnns = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddresses(conf)); } catch (Exception e) {
List<ConfiguredNNAddress> cnns = null; try { cnns = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddresses(conf)); } catch (Exception e) {
private void verifyAddresses(HdfsConfiguration conf, TestType type, boolean checkPort, String... expected) throws Exception { // Ensure DFSUtil returned the right set of addresses Map<String, Map<String, InetSocketAddress>> map = getAddressListFromConf(type, conf); List<ConfiguredNNAddress> list = DFSUtil.flattenAddressMap(map); String[] actual = toStringArray(list); Arrays.sort(actual); Arrays.sort(expected); assertArrayEquals(expected, actual); // Test GetConf returned addresses getAddressListFromTool(type, conf, checkPort, list); }
List<ConfiguredNNAddress> nns = null; try { nns = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddresses(conf)); } catch (Exception e) {
List<ConfiguredNNAddress> nns = null; try { nns = DFSUtil.flattenAddressMap( DFSUtil.getNNServiceRpcAddresses(conf)); } catch (Exception e) {