void printSet(Set<String> journalnodes) { StringBuilder buffer = new StringBuilder(); for (String journalnode : journalnodes) { if (buffer.length() > 0) { buffer.append(" "); } buffer.append(journalnode); } 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()); }
/** Method to be overridden by sub classes for specific behavior */ int doWorkInternal(GetConf tool, String[] args) throws Exception { String value = tool.getConf().getTrimmed(key); if (value != null) { tool.printOut(value); return 0; } tool.printError("Configuration " + key + " is missing."); 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; } }
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()); }
/** Method to be overridden by sub classes for specific behavior */ int doWorkInternal(GetConf tool, String[] args) throws Exception { String value = tool.getConf().getTrimmed(key); if (value != null) { tool.printOut(value); return 0; } tool.printError("Configuration " + key + " is missing."); return -1; } }
/** Method to be overridden by sub classes for specific behavior */ int doWorkInternal(GetConf tool, String[] args) throws Exception { String value = tool.getConf().getTrimmed(key); if (value != null) { tool.printOut(value); return 0; } tool.printError("Configuration " + key + " is missing."); 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; } }
@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; } }