LOG.info("Running 'run' command."); final Options commandOptions = CliFrontendParser.getRunCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, true); CliFrontendParser.printHelpForRun(customCommandLines); return;
public static void printHelpForCancel(Collection<CustomCommandLine<?>> customCommandLines) { HelpFormatter formatter = new HelpFormatter(); formatter.setLeftPadding(5); formatter.setWidth(80); System.out.println("\nAction \"cancel\" cancels a running program."); System.out.println("\n Syntax: cancel [OPTIONS] <Job ID>"); formatter.setSyntaxPrefix(" \"cancel\" action options:"); formatter.printHelp(" ", getCancelOptionsWithoutDeprecatedOptions(new Options())); printCustomCliOptions(customCommandLines, formatter, false); System.out.println(); }
public static void printHelpForInfo() { HelpFormatter formatter = new HelpFormatter(); formatter.setLeftPadding(5); formatter.setWidth(80); System.out.println("\nAction \"info\" shows the optimized execution plan of the program (JSON)."); System.out.println("\n Syntax: info [OPTIONS] <jar-file> <arguments>"); formatter.setSyntaxPrefix(" \"info\" action options:"); formatter.printHelp(" ", getInfoOptionsWithoutDeprecatedOptions(new Options())); System.out.println(); }
static Options getInfoCommandOptions() { Options options = buildGeneralOptions(new Options()); return getProgramSpecificOptions(options); }
private static Options collectCommandLineOptions(List<CustomCommandLine<?>> commandLines) { final Options customOptions = new Options(); for (CustomCommandLine<?> customCommandLine : commandLines) { customCommandLine.addRunOptions(customOptions); } return CliFrontendParser.mergeOptions( CliFrontendParser.getRunCommandOptions(), customOptions); }
public static void printHelpForList(Collection<CustomCommandLine<?>> customCommandLines) { HelpFormatter formatter = new HelpFormatter(); formatter.setLeftPadding(5); formatter.setWidth(80); System.out.println("\nAction \"list\" lists running and scheduled programs."); System.out.println("\n Syntax: list [OPTIONS]"); formatter.setSyntaxPrefix(" \"list\" action options:"); formatter.printHelp(" ", getListOptionsWithoutDeprecatedOptions(new Options())); printCustomCliOptions(customCommandLines, formatter, false); System.out.println(); }
LOG.info("Running 'list' command."); final Options commandOptions = CliFrontendParser.getListCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); CliFrontendParser.printHelpForList(customCommandLines); return;
LOG.info("Running 'stop' command."); final Options commandOptions = CliFrontendParser.getStopCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); CliFrontendParser.printHelpForStop(customCommandLines); return;
LOG.info("Running 'savepoint' command."); final Options commandOptions = CliFrontendParser.getSavepointCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); CliFrontendParser.printHelpForSavepoint(customCommandLines); return;
LOG.info("Running 'cancel' command."); final Options commandOptions = CliFrontendParser.getCancelCommandOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); CliFrontendParser.printHelpForCancel(customCommandLines); return;
protected void modify(String[] args) throws CliArgsException, FlinkException { LOG.info("Running 'modify' command."); final Options commandOptions = CliFrontendParser.getModifyOptions(); final Options commandLineOptions = CliFrontendParser.mergeOptions(commandOptions, customCommandLineOptions); final CommandLine commandLine = CliFrontendParser.parse(commandLineOptions, args, false); CliFrontendParser.printHelpForModify(customCommandLines);
LOG.info("Running 'info' command."); final Options commandOptions = CliFrontendParser.getInfoCommandOptions(); final CommandLine commandLine = CliFrontendParser.parse(commandOptions, args, true); CliFrontendParser.printHelpForInfo(); return;
public static void printHelpForRun(Collection<CustomCommandLine<?>> customCommandLines) { HelpFormatter formatter = new HelpFormatter(); formatter.setLeftPadding(5); formatter.setWidth(80); System.out.println("\nAction \"run\" compiles and runs a program."); System.out.println("\n Syntax: run [OPTIONS] <jar-file> <arguments>"); formatter.setSyntaxPrefix(" \"run\" action options:"); formatter.printHelp(" ", getRunOptionsWithoutDeprecatedOptions(new Options())); printCustomCliOptions(customCommandLines, formatter, true); System.out.println(); }
public static void printHelpForSavepoint(Collection<CustomCommandLine<?>> customCommandLines) { HelpFormatter formatter = new HelpFormatter(); formatter.setLeftPadding(5); formatter.setWidth(80); System.out.println("\nAction \"savepoint\" triggers savepoints for a running job or disposes existing ones."); System.out.println("\n Syntax: savepoint [OPTIONS] <Job ID> [<target directory>]"); formatter.setSyntaxPrefix(" \"savepoint\" action options:"); formatter.printHelp(" ", getSavepointOptionsWithoutDeprecatedOptions(new Options())); printCustomCliOptions(customCommandLines, formatter, false); System.out.println(); }
default CommandLine parseCommandLineOptions(String[] args, boolean stopAtNonOptions) throws CliArgsException { final Options options = new Options(); addGeneralOptions(options); addRunOptions(options); return CliFrontendParser.parse(options, args, stopAtNonOptions); } }
@Test public void testListOptions() throws Exception { // test configure all job { String[] parameters = {"-a"}; ListOptions options = new ListOptions(CliFrontendParser.parse( CliFrontendParser.getListCommandOptions(), parameters, true)); assertTrue(options.showAll()); assertFalse(options.showRunning()); assertFalse(options.showScheduled()); } // test configure running job { String[] parameters = {"-r"}; ListOptions options = new ListOptions(CliFrontendParser.parse( CliFrontendParser.getListCommandOptions(), parameters, true)); assertFalse(options.showAll()); assertTrue(options.showRunning()); assertFalse(options.showScheduled()); } // test configure scheduled job { String[] parameters = {"-s"}; ListOptions options = new ListOptions(CliFrontendParser.parse( CliFrontendParser.getListCommandOptions(), parameters, true)); assertFalse(options.showAll()); assertFalse(options.showRunning()); assertTrue(options.showScheduled()); } }
private static Options getInfoOptions(Options options) { options = getProgramSpecificOptions(options); options = getJobManagerAddressOption(options); return addCustomCliOptions(options, false); }
public static void printHelpForInfo() { HelpFormatter formatter = new HelpFormatter(); formatter.setLeftPadding(5); formatter.setWidth(80); System.out.println("\nAction \"info\" shows the optimized execution plan of the program (JSON)."); System.out.println("\n Syntax: info [OPTIONS] <jar-file> <arguments>"); formatter.setSyntaxPrefix(" \"info\" action options:"); formatter.printHelp(" ", getInfoOptionsWithoutDeprecatedOptions(new Options())); printCustomCliOptions(formatter, false); System.out.println(); }
private static Options getRunOptionsWithoutDeprecatedOptions(Options options) { Options o = getProgramSpecificOptionsWithoutDeprecatedOptions(options); o.addOption(SAVEPOINT_PATH_OPTION); return o.addOption(SAVEPOINT_ALLOW_NON_RESTORED_OPTION); }
private static Options getRunOptionsWithoutDeprecatedOptions(Options options) { Options o = getProgramSpecificOptionsWithoutDeprecatedOptions(options); o.addOption(SAVEPOINT_PATH_OPTION); o.addOption(SAVEPOINT_ALLOW_NON_RESTORED_OPTION); return getJobManagerAddressOption(o); }