private static int handleCliArgsException(CliArgsException e) { LOG.error("Could not parse the command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; }
public static CommandLine parse(Options options, String[] args, boolean stopAtNonOptions) throws CliArgsException { final DefaultParser parser = new DefaultParser(); try { return parser.parse(options, args, stopAtNonOptions); } catch (ParseException e) { throw new CliArgsException(e.getMessage()); } }
private JobID parseJobId(String jobIdString) throws CliArgsException { JobID jobId; try { jobId = JobID.fromHexString(jobIdString); } catch (IllegalArgumentException e) { throw new CliArgsException(e.getMessage()); } return jobId; }
/** * Displays an exception message for incorrect command line arguments. * * @param e The exception to display. * @return The return code for the process. */ private static int handleArgException(CliArgsException e) { LOG.error("Invalid command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; }
public static RunOptions parseRunCommand(String[] args) throws CliArgsException { try { DefaultParser parser = new DefaultParser(); CommandLine line = parser.parse(RUN_OPTIONS, args, true); return new RunOptions(line); } catch (ParseException e) { throw new CliArgsException(e.getMessage()); } }
@Test public void testTriggerSavepointFailureIllegalJobID() throws Exception { replaceStdOutAndStdErr(); try { CliFrontend frontend = new MockedCliFrontend(new StandaloneClusterClient( getConfiguration(), new TestingHighAvailabilityServices(), false)); String[] parameters = { "invalid job id" }; try { frontend.savepoint(parameters); fail("Should have failed."); } catch (CliArgsException e) { assertThat(e.getMessage(), Matchers.containsString("Cannot parse JobID")); } } finally { restoreStdOutAndStdErr(); } }
classpaths.add(new URL(path)); } catch (MalformedURLException e) { throw new CliArgsException("Bad syntax for classpath: " + path); throw new CliArgsException("The parallelism must be a positive number: " + parString);
private static int handleCliArgsException(CliArgsException e) { LOG.error("Could not parse the command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; }
jobId = parseJobId(modifyArgs[0]); } else { throw new CliArgsException("Missing JobId"); newParallelism = Integer.parseInt(commandLine.getOptionValue(MODIFY_PARALLELISM_OPTION.getOpt())); } catch (NumberFormatException e) { throw new CliArgsException("Could not parse the parallelism which is supposed to be an integer.", e); throw new CliArgsException("Missing new parallelism.");
private static int handleCliArgsException(CliArgsException e) { LOG.error("Could not parse the command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; }
throw new CliArgsException("The program JAR file was not specified."); throw new CliArgsException("Could not build the program from JAR file.", e);
/** * Displays an exception message for incorrect command line arguments. * * @param e The exception to display. * @return The return code for the process. */ private static int handleArgException(CliArgsException e) { LOG.error("Invalid command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; }
throw new CliArgsException("The program JAR file was not specified.");
/** * Displays an exception message for incorrect command line arguments. * * @param e The exception to display. * @return The return code for the process. */ private static int handleArgException(CliArgsException e) { LOG.error("Invalid command line arguments.", e); System.out.println(e.getMessage()); System.out.println(); System.out.println("Use the help option (-h or --help) to get help on the command."); return 1; }
jobId = parseJobId(jobIdString); } else { throw new CliArgsException("Missing JobID");
throw new CliArgsException("Missing JobID. " + "Specify a Job ID to trigger a savepoint.");
jobId = parseJobId(cleanedArgs[0]); } else { throw new CliArgsException("Missing JobID. Specify a JobID to cancel a job.");
private JobID parseJobId(String jobIdString) throws CliArgsException { JobID jobId; try { jobId = JobID.fromHexString(jobIdString); } catch (IllegalArgumentException e) { throw new CliArgsException(e.getMessage()); } return jobId; }
public static CommandLine parse(Options options, String[] args, boolean stopAtNonOptions) throws CliArgsException { final DefaultParser parser = new DefaultParser(); try { return parser.parse(options, args, stopAtNonOptions); } catch (ParseException e) { throw new CliArgsException(e.getMessage()); } }
private JobID parseJobId(String jobIdString) throws CliArgsException { JobID jobId; try { jobId = JobID.fromHexString(jobIdString); } catch (IllegalArgumentException e) { throw new CliArgsException(e.getMessage()); } return jobId; }