@Test public void assertUpdateJobConfig() { JobConfigurationPOJO jobConfiguration = new JobConfigurationPOJO(); jobConfiguration.setJobName("test_job"); jobConfiguration.setCron("0/1 * * * * ?"); jobConfiguration.setShardingTotalCount(3); jobConfiguration.setJobParameter("param"); jobConfiguration.setMonitorExecution(true); jobConfiguration.setFailover(false); jobConfiguration.setMisfire(true); jobConfiguration.setMaxTimeDiffSeconds(-1); jobConfiguration.setReconcileIntervalMinutes(10); jobConfiguration.setDescription(""); jobConfiguration.getProps().setProperty(DataflowJobProperties.STREAM_PROCESS_KEY, "true"); jobConfigAPI.updateJobConfiguration(jobConfiguration); verify(regCenter).update("/test_job/config", LifecycleYamlConstants.getDataflowJobYaml()); }
@Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); } }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }  }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }  @Override JobConfigurationPOJO getJobConfiguration(final String jobName); @Override void updateJobConfiguration(final JobConfigurationPOJO jobConfig); @Override void removeJobConfiguration(final String jobName); }
JobConfigurationAPIImpl implements JobConfigurationAPI { @Override public void updateJobConfiguration(final JobConfigurationPOJO jobConfig) { Preconditions.checkArgument(!Strings.isNullOrEmpty(jobConfig.getJobName()), "jobName can not be empty."); Preconditions.checkArgument(jobConfig.getShardingTotalCount() > 0, "shardingTotalCount should larger than zero."); JobNodePath jobNodePath = new JobNodePath(jobConfig.getJobName()); regCenter.update(jobNodePath.getConfigNodePath(), YamlEngine.marshal(jobConfig)); }  @Override JobConfigurationPOJO getJobConfiguration(final String jobName); @Override void updateJobConfiguration(final JobConfigurationPOJO jobConfig); @Override void removeJobConfiguration(final String jobName);  }