/** * Prints custom cli options. * @param formatter The formatter to use for printing * @param runOptions True if the run options should be printed, False to print only general options */ private static void printCustomCliOptions( Collection<CustomCommandLine<?>> customCommandLines, HelpFormatter formatter, boolean runOptions) { // prints options from all available command-line classes for (CustomCommandLine cli: customCommandLines) { formatter.setSyntaxPrefix(" Options for " + cli.getId() + " mode:"); Options customOpts = new Options(); cli.addGeneralOptions(customOpts); if (runOptions) { cli.addRunOptions(customOpts); } formatter.printHelp(" ", customOpts); System.out.println(); } }
/** * Prints custom cli options * @param formatter The formatter to use for printing * @param runOptions True if the run options should be printed, False to print only general options */ private static void printCustomCliOptions(HelpFormatter formatter, boolean runOptions) { // prints options from all available command-line classes for (CustomCommandLine cli: CliFrontend.getCustomCommandLineList()) { if (cli.getId() != null) { formatter.setSyntaxPrefix(" Options for " + cli.getId() + " mode:"); Options customOpts = new Options(); cli.addGeneralOptions(customOpts); if (runOptions) { cli.addRunOptions(customOpts); } formatter.printHelp(" ", customOpts); System.out.println(); } } }
/** * Prints custom cli options. * @param formatter The formatter to use for printing * @param runOptions True if the run options should be printed, False to print only general options */ private static void printCustomCliOptions( Collection<CustomCommandLine<?>> customCommandLines, HelpFormatter formatter, boolean runOptions) { // prints options from all available command-line classes for (CustomCommandLine cli: customCommandLines) { formatter.setSyntaxPrefix(" Options for " + cli.getId() + " mode:"); Options customOpts = new Options(); cli.addGeneralOptions(customOpts); if (runOptions) { cli.addRunOptions(customOpts); } formatter.printHelp(" ", customOpts); System.out.println(); } }
/** * Prints custom cli options. * @param formatter The formatter to use for printing * @param runOptions True if the run options should be printed, False to print only general options */ private static void printCustomCliOptions( Collection<CustomCommandLine<?>> customCommandLines, HelpFormatter formatter, boolean runOptions) { // prints options from all available command-line classes for (CustomCommandLine cli: customCommandLines) { formatter.setSyntaxPrefix(" Options for " + cli.getId() + " mode:"); Options customOpts = new Options(); cli.addGeneralOptions(customOpts); if (runOptions) { cli.addRunOptions(customOpts); } formatter.printHelp(" ", customOpts); System.out.println(); } }
/** * Updates the associated configuration with the given command line options * * @param options Command line options */ protected ClusterClient retrieveClient(CommandLineOptions options) { CustomCommandLine customCLI = getActiveCustomCommandLine(options.getCommandLine()); try { ClusterClient client = customCLI.retrieveCluster(options.getCommandLine(), config); logAndSysout("Using address " + client.getJobManagerAddress() + " to connect to JobManager."); return client; } catch (Exception e) { LOG.error("Couldn't retrieve {} cluster.", customCLI.getId(), e); throw new IllegalConfigurationException("Couldn't retrieve client for cluster", e); } }