@@ -17,6 +17,7 @@ package org.springframework.cloud.task.batch.partition;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -246,7 +247,7 @@ public class DeployerPartitionHandler implements PartitionHandler, EnvironmentAw
|
||||
final Set<StepExecution> executed = new HashSet<>(candidates.size());
|
||||
|
||||
if (CollectionUtils.isEmpty(candidates)) {
|
||||
return null;
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
launchWorkers(candidates, executed);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class DeployerPartitionHandlerTests {
|
||||
Collection<StepExecution> results = handler.handle(this.splitter, stepExecution);
|
||||
|
||||
verify(this.taskLauncher, never()).launch((AppDeploymentRequest) any());
|
||||
assertNull(results);
|
||||
assertTrue(results.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -325,8 +325,9 @@ public class JdbcTaskExecutionDao implements TaskExecutionDao {
|
||||
public long getRunningTaskExecutionCount() {
|
||||
|
||||
try {
|
||||
final MapSqlParameterSource queryParameters = new MapSqlParameterSource();
|
||||
return jdbcTemplate.queryForObject(
|
||||
getQuery(RUNNING_TASK_EXECUTION_COUNT), (SqlParameterSource)null, Long.class);
|
||||
getQuery(RUNNING_TASK_EXECUTION_COUNT), queryParameters, Long.class);
|
||||
}
|
||||
catch (EmptyResultDataAccessException e) {
|
||||
return 0;
|
||||
|
||||
@@ -322,7 +322,7 @@ public class MapTaskExecutionDao implements TaskExecutionDao {
|
||||
}
|
||||
}
|
||||
|
||||
private class TaskExecutionComparator implements Comparator<TaskExecution> {
|
||||
private static class TaskExecutionComparator implements Comparator<TaskExecution> {
|
||||
@Override
|
||||
public int compare(TaskExecution firstTaskExecution, TaskExecution secondTaskExecution) {
|
||||
if (firstTaskExecution.getStartTime().equals(secondTaskExecution.getStartTime())) {
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TaskApplication {
|
||||
/**
|
||||
* A commandline runner that prints a timestamp.
|
||||
*/
|
||||
public class TimestampTask implements CommandLineRunner {
|
||||
public static class TimestampTask implements CommandLineRunner {
|
||||
|
||||
@Autowired
|
||||
private TimestampTaskProperties config;
|
||||
|
||||
@@ -55,7 +55,7 @@ public class JobExecutionEvent extends Entity {
|
||||
|
||||
private Date lastUpdated = null;
|
||||
|
||||
private ExitStatus exitStatus = new ExitStatus(new org.springframework.batch.core.ExitStatus("UNKNOWN", null));
|
||||
private ExitStatus exitStatus = new ExitStatus(new org.springframework.batch.core.ExitStatus("UNKNOWN"));
|
||||
|
||||
private ExecutionContext executionContext = new ExecutionContext();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user