@Test public void testHelp() throws Exception { HalyardMain.main(new String[]{"-h"}); }
public static void main(String args[]) throws Exception { String first = args.length > 0 ? args[0] : null; if ("-v".equals(first) || "--version".equals(first)) { System.out.println("halyard version " + AbstractHalyardTool.getVersion()); } else { AbstractHalyardTool tools[] = new AbstractHalyardTool[] { new HalyardPreSplit(), new HalyardBulkLoad(), new HalyardStats(), new HalyardElasticIndexer(), new HalyardUpdate(), new HalyardBulkUpdate(), new HalyardExport(), new HalyardBulkExport(), new HalyardBulkDelete(), new HalyardProfile(), new HalyardEndpoint(), new HalyardSummary() }; for (AbstractHalyardTool tool : tools) { if (tool.name.equalsIgnoreCase(first)) { int ret = ToolRunner.run(tool, Arrays.copyOfRange(args, 1, args.length)); if (ret != 0) throw new RuntimeException("Tool " + tool.name + " exits with code: " + ret); return; } } try { if (first != null && !"-h".equals(first) && !"--help".equals(first)) { String msg = "Unrecognized command or option: " + first; System.out.println(msg); throw new UnrecognizedOptionException(msg); } } finally { PrintWriter pw = new PrintWriter(System.out); HelpFormatter hf = new HelpFormatter(); hf.printWrapped(pw, 100, "usage: halyard [ -h | -v | <command> [<genericHadoopOptions>] [-h] ...]"); hf.printWrapped(pw, 100, "\ncommands are:\n----------------------------------------------------------------------------------------------------"); for (AbstractHalyardTool tool : tools) { hf.printWrapped(pw, 100, 11, tool.name + " ".substring(tool.name.length()) + tool.header); } hf.printWrapped(pw, 100, 0, "\ngenericHadoopOptions are:\n----------------------------------------------------------------------------------------------------"); hf.printWrapped(pw, 100, 45, "-conf <configuration file> specify an application configuration file"); hf.printWrapped(pw, 100, 45, "-D <property=value> use value for given property"); hf.printWrapped(pw, 100, 45, "-fs <local|namenode:port> specify a namenode"); hf.printWrapped(pw, 100, 45, "-jt <local|jobtracker:port> specify a job tracker"); hf.printWrapped(pw, 100, 45, "-files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster"); hf.printWrapped(pw, 100, 45, "-archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines."); hf.printWrapped(pw, 100, 0, "\nJVM options of the Halyard command and local command-line applications can be specified using HADOOP_OPTS and HADOOP_CLIENT_OPTS environment variables, however JVM options of the Halyard MapReduce applications can only be modified using specific Hadoop properties."); pw.flush(); } } }
HalyardMain { public static void main(String args[]) throws Exception { String first = args.length > 0 ? args[0] : null; if ("-v".equals(first) || "--version".equals(first)) { System.out.println("halyard version " + AbstractHalyardTool.getVersion()); } else { AbstractHalyardTool tools[] = new AbstractHalyardTool[] { new HalyardPreSplit(), new HalyardBulkLoad(), new HalyardStats(), new HalyardElasticIndexer(), new HalyardUpdate(), new HalyardBulkUpdate(), new HalyardExport(), new HalyardBulkExport(), new HalyardBulkDelete(), new HalyardProfile(), new HalyardEndpoint(), new HalyardSummary() }; for (AbstractHalyardTool tool : tools) { if (tool.name.equalsIgnoreCase(first)) { int ret = ToolRunner.run(tool, Arrays.copyOfRange(args, 1, args.length)); if (ret != 0) throw new RuntimeException("Tool " + tool.name + " exits with code: " + ret); return; } } try { if (first != null && !"-h".equals(first) && !"--help".equals(first)) { String msg = "Unrecognized command or option: " + first; System.out.println(msg); throw new UnrecognizedOptionException(msg); } } finally { PrintWriter pw = new PrintWriter(System.out); HelpFormatter hf = new HelpFormatter(); hf.printWrapped(pw, 100, "usage: halyard [ -h | -v | <command> [<genericHadoopOptions>] [-h] ...]"); hf.printWrapped(pw, 100, "\ncommands are:\n----------------------------------------------------------------------------------------------------"); for (AbstractHalyardTool tool : tools) { hf.printWrapped(pw, 100, 11, tool.name + " ".substring(tool.name.length()) + tool.header); } hf.printWrapped(pw, 100, 0, "\ngenericHadoopOptions are:\n----------------------------------------------------------------------------------------------------"); hf.printWrapped(pw, 100, 45, "-conf <configuration file> specify an application configuration file"); hf.printWrapped(pw, 100, 45, "-D <property=value> use value for given property"); hf.printWrapped(pw, 100, 45, "-fs <local|namenode:port> specify a namenode"); hf.printWrapped(pw, 100, 45, "-jt <local|jobtracker:port> specify a job tracker"); hf.printWrapped(pw, 100, 45, "-files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster"); hf.printWrapped(pw, 100, 45, "-archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines."); hf.printWrapped(pw, 100, 0, "\nJVM options of the Halyard command and local command-line applications can be specified using HADOOP_OPTS and HADOOP_CLIENT_OPTS environment variables, however JVM options of the Halyard MapReduce applications can only be modified using specific Hadoop properties."); pw.flush(); } } } }
HalyardMain { public static void main(String args[]) throws Exception { String first = args.length > 0 ? args[0] : null; if ("-v".equals(first) || "--version".equals(first)) { System.out.println("halyard version " + AbstractHalyardTool.getVersion()); } else { AbstractHalyardTool tools[] = new AbstractHalyardTool[] { new HalyardPreSplit(), new HalyardBulkLoad(), new HalyardStats(), new HalyardElasticIndexer(), new HalyardUpdate(), new HalyardBulkUpdate(), new HalyardExport(), new HalyardBulkExport(), new HalyardBulkDelete(), new HalyardProfile(), new HalyardEndpoint(), new HalyardSummary() }; for (AbstractHalyardTool tool : tools) { if (tool.name.equalsIgnoreCase(first)) { int ret = ToolRunner.run(tool, Arrays.copyOfRange(args, 1, args.length)); if (ret != 0) throw new RuntimeException("Tool " + tool.name + " exits with code: " + ret); return; } } try { if (first != null && !"-h".equals(first) && !"--help".equals(first)) { String msg = "Unrecognized command or option: " + first; System.out.println(msg); throw new UnrecognizedOptionException(msg); } } finally { PrintWriter pw = new PrintWriter(System.out); HelpFormatter hf = new HelpFormatter(); hf.printWrapped(pw, 100, "usage: halyard [ -h | -v | <command> [<genericHadoopOptions>] [-h] ...]"); hf.printWrapped(pw, 100, "\ncommands are:\n----------------------------------------------------------------------------------------------------"); for (AbstractHalyardTool tool : tools) { hf.printWrapped(pw, 100, 11, tool.name + " ".substring(tool.name.length()) + tool.header); } hf.printWrapped(pw, 100, 0, "\ngenericHadoopOptions are:\n----------------------------------------------------------------------------------------------------"); hf.printWrapped(pw, 100, 45, "-conf <configuration file> specify an application configuration file"); hf.printWrapped(pw, 100, 45, "-D <property=value> use value for given property"); hf.printWrapped(pw, 100, 45, "-fs <local|namenode:port> specify a namenode"); hf.printWrapped(pw, 100, 45, "-jt <local|jobtracker:port> specify a job tracker"); hf.printWrapped(pw, 100, 45, "-files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster"); hf.printWrapped(pw, 100, 45, "-archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines."); hf.printWrapped(pw, 100, 0, "\nJVM options of the Halyard command and local command-line applications can be specified using HADOOP_OPTS and HADOOP_CLIENT_OPTS environment variables, however JVM options of the Halyard MapReduce applications can only be modified using specific Hadoop properties."); pw.flush(); } } } HalyardMain(); }
HalyardMain { public static void main(String args[]) throws Exception { String first = args.length > 0 ? args[0] : null; if ("-v".equals(first) || "--version".equals(first)) { System.out.println("halyard version " + AbstractHalyardTool.getVersion()); } else { AbstractHalyardTool tools[] = new AbstractHalyardTool[] { new HalyardPreSplit(), new HalyardBulkLoad(), new HalyardStats(), new HalyardElasticIndexer(), new HalyardUpdate(), new HalyardBulkUpdate(), new HalyardExport(), new HalyardBulkExport(), new HalyardBulkDelete(), new HalyardProfile(), new HalyardEndpoint(), new HalyardSummary() }; for (AbstractHalyardTool tool : tools) { if (tool.name.equalsIgnoreCase(first)) { int ret = ToolRunner.run(tool, Arrays.copyOfRange(args, 1, args.length)); if (ret != 0) throw new RuntimeException("Tool " + tool.name + " exits with code: " + ret); return; } } try { if (first != null && !"-h".equals(first) && !"--help".equals(first)) { String msg = "Unrecognized command or option: " + first; System.out.println(msg); throw new UnrecognizedOptionException(msg); } } finally { PrintWriter pw = new PrintWriter(System.out); HelpFormatter hf = new HelpFormatter(); hf.printWrapped(pw, 100, "usage: halyard [ -h | -v | <command> [<genericHadoopOptions>] [-h] ...]"); hf.printWrapped(pw, 100, "\ncommands are:\n----------------------------------------------------------------------------------------------------"); for (AbstractHalyardTool tool : tools) { hf.printWrapped(pw, 100, 11, tool.name + " ".substring(tool.name.length()) + tool.header); } hf.printWrapped(pw, 100, 0, "\ngenericHadoopOptions are:\n----------------------------------------------------------------------------------------------------"); hf.printWrapped(pw, 100, 45, "-conf <configuration file> specify an application configuration file"); hf.printWrapped(pw, 100, 45, "-D <property=value> use value for given property"); hf.printWrapped(pw, 100, 45, "-fs <local|namenode:port> specify a namenode"); hf.printWrapped(pw, 100, 45, "-jt <local|jobtracker:port> specify a job tracker"); hf.printWrapped(pw, 100, 45, "-files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster"); hf.printWrapped(pw, 100, 45, "-archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines."); hf.printWrapped(pw, 100, 0, "\nJVM options of the Halyard command and local command-line applications can be specified using HADOOP_OPTS and HADOOP_CLIENT_OPTS environment variables, however JVM options of the Halyard MapReduce applications can only be modified using specific Hadoop properties."); pw.flush(); } } } HalyardMain(); static void main(String args[]); }
HalyardMain { public static void main(String args[]) throws Exception { String first = args.length > 0 ? args[0] : null; if ("-v".equals(first) || "--version".equals(first)) { System.out.println("halyard version " + AbstractHalyardTool.getVersion()); } else { AbstractHalyardTool tools[] = new AbstractHalyardTool[] { new HalyardPreSplit(), new HalyardBulkLoad(), new HalyardStats(), new HalyardElasticIndexer(), new HalyardUpdate(), new HalyardBulkUpdate(), new HalyardExport(), new HalyardBulkExport(), new HalyardBulkDelete(), new HalyardProfile(), new HalyardEndpoint(), new HalyardSummary() }; for (AbstractHalyardTool tool : tools) { if (tool.name.equalsIgnoreCase(first)) { int ret = ToolRunner.run(tool, Arrays.copyOfRange(args, 1, args.length)); if (ret != 0) throw new RuntimeException("Tool " + tool.name + " exits with code: " + ret); return; } } try { if (first != null && !"-h".equals(first) && !"--help".equals(first)) { String msg = "Unrecognized command or option: " + first; System.out.println(msg); throw new UnrecognizedOptionException(msg); } } finally { PrintWriter pw = new PrintWriter(System.out); HelpFormatter hf = new HelpFormatter(); hf.printWrapped(pw, 100, "usage: halyard [ -h | -v | <command> [<genericHadoopOptions>] [-h] ...]"); hf.printWrapped(pw, 100, "\ncommands are:\n----------------------------------------------------------------------------------------------------"); for (AbstractHalyardTool tool : tools) { hf.printWrapped(pw, 100, 11, tool.name + " ".substring(tool.name.length()) + tool.header); } hf.printWrapped(pw, 100, 0, "\ngenericHadoopOptions are:\n----------------------------------------------------------------------------------------------------"); hf.printWrapped(pw, 100, 45, "-conf <configuration file> specify an application configuration file"); hf.printWrapped(pw, 100, 45, "-D <property=value> use value for given property"); hf.printWrapped(pw, 100, 45, "-fs <local|namenode:port> specify a namenode"); hf.printWrapped(pw, 100, 45, "-jt <local|jobtracker:port> specify a job tracker"); hf.printWrapped(pw, 100, 45, "-files <comma separated list of files> specify comma separated files to be copied to the map reduce cluster"); hf.printWrapped(pw, 100, 45, "-archives <comma separated list of archives> specify comma separated archives to be unarchived on the compute machines."); hf.printWrapped(pw, 100, 0, "\nJVM options of the Halyard command and local command-line applications can be specified using HADOOP_OPTS and HADOOP_CLIENT_OPTS environment variables, however JVM options of the Halyard MapReduce applications can only be modified using specific Hadoop properties."); pw.flush(); } } } HalyardMain(); static void main(String args[]);  }