@Test public void testShortOptions() throws FlinkParseException { final String configDir = "/foo/bar"; final String jobClassName = "foobar"; final JobID jobId = new JobID(); final String savepointRestorePath = "s3: final String[] args = { "-c", configDir, "-j", jobClassName, "-jid", jobId.toString(), "-s", savepointRestorePath, "-n"}; final StandaloneJobClusterConfiguration clusterConfiguration = commandLineParser.parse(args); assertThat(clusterConfiguration.getConfigDir(), is(equalTo(configDir))); assertThat(clusterConfiguration.getJobClassName(), is(equalTo(jobClassName))); assertThat(clusterConfiguration.getJobId(), is(equalTo(jobId))); final SavepointRestoreSettings savepointRestoreSettings = clusterConfiguration.getSavepointRestoreSettings(); assertThat(savepointRestoreSettings.restoreSavepoint(), is(true)); assertThat(savepointRestoreSettings.getRestorePath(), is(equalTo(savepointRestorePath))); assertThat(savepointRestoreSettings.allowNonRestoredState(), is(true)); }
private static JobID getJobId(CommandLine commandLine) throws FlinkParseException { String jobId = commandLine.getOptionValue(JOB_ID_OPTION.getOpt()); if (jobId == null) { return DEFAULT_JOB_ID; } try { return JobID.fromHexString(jobId); } catch (IllegalArgumentException e) { throw createFlinkParseException(JOB_ID_OPTION, e); } }
StandaloneJobClusterConfigurationParserFactory implements ParserResultFactory<StandaloneJobClusterConfiguration> { private static JobID getJobId(CommandLine commandLine) throws FlinkParseException { String jobId = commandLine.getOptionValue(JOB_ID_OPTION.getOpt()); if (jobId == null) { return DEFAULT_JOB_ID; } try { return JobID.fromHexString(jobId); } catch (IllegalArgumentException e) { throw createFlinkParseException(JOB_ID_OPTION, e); } } }
StandaloneJobClusterConfigurationParserFactory implements ParserResultFactory<StandaloneJobClusterConfiguration> { private static JobID getJobId(CommandLine commandLine) throws FlinkParseException { String jobId = commandLine.getOptionValue(JOB_ID_OPTION.getOpt()); if (jobId == null) { return DEFAULT_JOB_ID; } try { return JobID.fromHexString(jobId); } catch (IllegalArgumentException e) { throw createFlinkParseException(JOB_ID_OPTION, e); } }  }
StandaloneJobClusterConfigurationParserFactory implements ParserResultFactory<StandaloneJobClusterConfiguration> { private static JobID getJobId(CommandLine commandLine) throws FlinkParseException { String jobId = commandLine.getOptionValue(JOB_ID_OPTION.getOpt()); if (jobId == null) { return DEFAULT_JOB_ID; } try { return JobID.fromHexString(jobId); } catch (IllegalArgumentException e) { throw createFlinkParseException(JOB_ID_OPTION, e); } }  @Override Options getOptions(); @Override StandaloneJobClusterConfiguration createResult(@Nonnull CommandLine commandLine); }
StandaloneJobClusterConfigurationParserFactory implements ParserResultFactory<StandaloneJobClusterConfiguration> { private static JobID getJobId(CommandLine commandLine) throws FlinkParseException { String jobId = commandLine.getOptionValue(JOB_ID_OPTION.getOpt()); if (jobId == null) { return DEFAULT_JOB_ID; } try { return JobID.fromHexString(jobId); } catch (IllegalArgumentException e) { throw createFlinkParseException(JOB_ID_OPTION, e); } }  @Override Options getOptions(); @Override StandaloneJobClusterConfiguration createResult(@Nonnull CommandLine commandLine);  }