diff --git a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerJobFactory.java b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerJobFactory.java index 7013edd36b..964419645a 100644 --- a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerJobFactory.java +++ b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerJobFactory.java @@ -85,15 +85,12 @@ public class ComposedRunnerJobFactory implements FactoryBean { private String dsl; - private boolean incrementInstanceEnabled; - private int nestedSplits; public ComposedRunnerJobFactory(ComposedTaskProperties properties) { this.composedTaskProperties = properties; Assert.notNull(properties.getGraph(), "The DSL must not be null"); this.dsl = properties.getGraph(); - this.incrementInstanceEnabled = properties.isIncrementInstanceEnabled(); this.flowBuilder = new FlowBuilder<>(UUID.randomUUID().toString()); } @@ -112,10 +109,7 @@ public Job getObject() throws Exception { .start(createFlow()) .end()) .end(); - if(this.incrementInstanceEnabled && !this.composedTaskProperties.isUuidInstanceEnabled()) { - builder.incrementer(new RunIdIncrementer()); - } - else if(this.composedTaskProperties.isUuidInstanceEnabled()) { + if(this.composedTaskProperties.isUuidInstanceEnabled()) { builder.incrementer(new UuidIncrementer()); } return builder.build(); diff --git a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskProperties.java b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskProperties.java index b498e5e67b..4a12eeb6f9 100644 --- a/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskProperties.java +++ b/spring-cloud-dataflow-composed-task-runner/src/main/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskProperties.java @@ -188,21 +188,13 @@ public class ComposedTaskProperties { */ private boolean splitThreadWaitForTasksToCompleteOnShutdown; - /** - * Allows a single ComposedTaskRunner instance to be re-executed without - * changing the parameters. It does this by applying a {@code run.id} with a sequential - * number based on the {@code run.id} from the previous execution. Default is true. - */ - @Deprecated - private boolean incrementInstanceEnabled = true; - /** * Allows a single ComposedTaskRunner instance to be re-executed without * changing the parameters. It does this by applying a {@code run.id} with a UUid. - * Default is false. If set to true then this will override incrementInstanceEnabled. + * Default is true. * Set this option to `true` when running multiple instances of the same composed task definition at the same time. */ - private boolean uuidInstanceEnabled = false; + private boolean uuidInstanceEnabled = true; /** * The platform property that will be used for each task in the workflow when it is launched. @@ -365,14 +357,6 @@ public void setSplitThreadWaitForTasksToCompleteOnShutdown(boolean splitThreadWa this.splitThreadWaitForTasksToCompleteOnShutdown = splitThreadWaitForTasksToCompleteOnShutdown; } - public boolean isIncrementInstanceEnabled() { - return incrementInstanceEnabled; - } - - public void setIncrementInstanceEnabled(boolean incrementInstanceEnabled) { - this.incrementInstanceEnabled = incrementInstanceEnabled; - } - public String getDataflowServerAccessToken() { return dataflowServerAccessToken; } diff --git a/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerVisitorTests.java b/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerVisitorTests.java index e56b89241e..4efeea8326 100644 --- a/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerVisitorTests.java +++ b/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/ComposedRunnerVisitorTests.java @@ -87,7 +87,7 @@ void singleTest() { @Test void singleTestForuuIDIncrementer() { setupContextForGraph("AAA", "--uuIdInstanceEnabled=true"); - Collection stepExecutions = getStepExecutions(true); + Collection stepExecutions = getStepExecutions(); assertThat(stepExecutions).hasSize(1); StepExecution stepExecution = stepExecutions.iterator().next(); assertThat(stepExecution.getStepName()).isEqualTo("AAA_0"); @@ -397,11 +397,8 @@ private void setupContextForGraph(String[] args) throws RuntimeException{ SimpleTaskAutoConfiguration.class}, args); } - private Collection getStepExecutions() { - return getStepExecutions(false); - } - private Collection getStepExecutions(boolean isCTR) { + private Collection getStepExecutions() { JobExplorer jobExplorer = this.applicationContext.getBean(JobExplorer.class); List jobInstances = jobExplorer.findJobInstancesByJobName("job", 0, 1); assertThat(jobInstances).hasSize(1); @@ -409,11 +406,7 @@ private Collection getStepExecutions(boolean isCTR) { List jobExecutions = jobExplorer.getJobExecutions(jobInstance); assertThat(jobExecutions).hasSize(1); JobExecution jobExecution = jobExecutions.get(0); - if(isCTR) { - assertThat(jobExecution.getJobParameters().getParameters().get("ctr.id")).isNotNull(); - } else { - assertThat(jobExecution.getJobParameters().getParameters()).containsEntry("run.id", new JobParameter(1L, Long.class)); - } + assertThat(jobExecution.getJobParameters().getParameters().get("ctr.id")).isNotNull(); return jobExecution.getStepExecutions(); } diff --git a/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskPropertiesTests.java b/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskPropertiesTests.java index 221e914c0b..ca437ef8cc 100644 --- a/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskPropertiesTests.java +++ b/spring-cloud-dataflow-composed-task-runner/src/test/java/org/springframework/cloud/dataflow/composedtaskrunner/properties/ComposedTaskPropertiesTests.java @@ -66,11 +66,8 @@ void gettersAndSetters() throws URISyntaxException{ assertThat(properties.getDataflowServerPassword()).isEqualTo("bar"); assertThat(properties.getDataflowServerAccessToken()).isEqualTo("foobar"); assertThat(properties.isSkipTlsCertificateVerification()).isTrue(); - assertThat(properties.isIncrementInstanceEnabled()).isTrue(); - assertThat(properties.isUuidInstanceEnabled()).isFalse(); + assertThat(properties.isUuidInstanceEnabled()).isTrue(); properties.setUuidInstanceEnabled(true); - properties.setIncrementInstanceEnabled(false); - assertThat(properties.isIncrementInstanceEnabled()).isFalse(); assertThat(properties.isUuidInstanceEnabled()).isTrue(); }