private void printUsage() { printError(USAGE); }
final int doWork(GetConf tool, String[] args) { try { checkArgs(args); return doWorkInternal(tool, args); } catch (Exception e) { tool.printError(e.getMessage()); } 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; } }
/** 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; } }
private void printUsage() { printError(USAGE); }
private void printUsage() { printError(USAGE); }
final int doWork(GetConf tool, String[] args) { try { checkArgs(args); return doWorkInternal(tool, args); } catch (Exception e) { tool.printError(e.getMessage()); } return -1; }
final int doWork(GetConf tool, String[] args) { try { checkArgs(args); return doWorkInternal(tool, args); } catch (Exception e) { tool.printError(e.getMessage()); } 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; } }
/** 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; } }