Interface DataflowTaskExecutionQueryDao
- All Known Implementing Classes:
DefaultDataFlowTaskExecutionQueryDao
public interface DataflowTaskExecutionQueryDao
Repository to access
TaskExecutions. Mirrors the TaskExecutionDao
but contains Spring Cloud Data Flow specific operations. This functionality might
be migrated to Spring Cloud Task itself.- Since:
- 2.11.0
- Author:
- Corneil du Plessis
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.data.domain.Page<org.springframework.cloud.task.repository.TaskExecution>findAll(org.springframework.data.domain.Pageable pageable) Retrieves all the task executions within the pageable constraints.List<org.springframework.cloud.task.repository.TaskExecution>findChildTaskExecutions(long executionId) Retrieves a list of task executions where the provided execution id and schemaTarget represents the parent of task execution.List<org.springframework.cloud.task.repository.TaskExecution>findChildTaskExecutions(Collection<Long> parentIds) Retrieves a list of task executions where the provided execution ids and schemaTarget represents the parents of task executions.List<org.springframework.cloud.task.repository.TaskExecution>findTaskExecutions(String taskName, boolean completed) Find task executions by task name and completion status.List<org.springframework.cloud.task.repository.TaskExecution>findTaskExecutionsBeforeEndTime(String taskName, Date endTime) Find task executions by task name whose end date is before the specified date.org.springframework.cloud.task.repository.TaskExecutiongeTaskExecutionByExecutionId(String executionId, String taskName) longRetrieves current number of task executions for a taskName and with a non-null endTime.longgetCompletedTaskExecutionCountByTaskNameAndBeforeDate(String taskName, Date endTime) Retrieves current number of task executions for a taskName and with a non-null endTime before the specified date.org.springframework.cloud.task.repository.TaskExecutiongetLatestTaskExecutionForTaskName(String taskName) Returns the latest task execution for a given task name.List<org.springframework.cloud.task.repository.TaskExecution>getLatestTaskExecutionsByTaskNames(String... taskNames) Returns aListof the latestTaskExecutionfor 1 or more task names.longRetrieves current number of task executions with an endTime of null.longgetRunningTaskExecutionCountByTaskName(String taskName) Retrieves current number of task executions for a taskName and with an endTime of null.org.springframework.cloud.task.repository.TaskExecutiongetTaskExecution(long executionId) Retrieves a task execution from the task repository.longRetrieves current number of task executions.longgetTaskExecutionCountByTaskName(String taskName) Retrieves current number of task executions for a taskName.voidpopulateCtrStatus(Collection<ThinTaskExecution> thinTaskExecutions)
-
Method Details
-
getTaskExecution
org.springframework.cloud.task.repository.TaskExecution getTaskExecution(long executionId) Retrieves a task execution from the task repository.- Parameters:
executionId- the id associated with the task execution.- Returns:
- a fully qualified TaskExecution instance.
-
findChildTaskExecutions
List<org.springframework.cloud.task.repository.TaskExecution> findChildTaskExecutions(long executionId) Retrieves a list of task executions where the provided execution id and schemaTarget represents the parent of task execution.- Parameters:
executionId- parent task execution id- Returns:
- the task executions
-
findChildTaskExecutions
List<org.springframework.cloud.task.repository.TaskExecution> findChildTaskExecutions(Collection<Long> parentIds) Retrieves a list of task executions where the provided execution ids and schemaTarget represents the parents of task executions.- Parameters:
parentIds- parent task execution ids- Returns:
- the task executions
-
findTaskExecutions
List<org.springframework.cloud.task.repository.TaskExecution> findTaskExecutions(String taskName, boolean completed) Find task executions by task name and completion status.- Parameters:
taskName- the name of the task to search for in the repository.completed- whether to include only completed task executions.- Returns:
- list of task executions
-
findTaskExecutionsBeforeEndTime
List<org.springframework.cloud.task.repository.TaskExecution> findTaskExecutionsBeforeEndTime(String taskName, @NonNull Date endTime) Find task executions by task name whose end date is before the specified date.- Parameters:
taskName- the name of the task to search for in the repository.endTime- the time before the task ended.- Returns:
- list of task executions.
-
getTaskExecutionCountByTaskName
Retrieves current number of task executions for a taskName.- Parameters:
taskName- the name of the task- Returns:
- current number of task executions for the taskName.
-
getCompletedTaskExecutionCountByTaskNameAndBeforeDate
Retrieves current number of task executions for a taskName and with a non-null endTime before the specified date.- Parameters:
taskName- the name of the taskendTime- the time before task ended- Returns:
- the number of completed task executions
-
getCompletedTaskExecutionCountByTaskName
Retrieves current number of task executions for a taskName and with a non-null endTime.- Parameters:
taskName- the name of the task- Returns:
- the number of completed task executions
-
getRunningTaskExecutionCountByTaskName
Retrieves current number of task executions for a taskName and with an endTime of null.- Parameters:
taskName- the name of the task to search for in the repository.- Returns:
- the number of running task executions
-
getRunningTaskExecutionCount
long getRunningTaskExecutionCount()Retrieves current number of task executions with an endTime of null.- Returns:
- current number of task executions.
-
getTaskExecutionCount
long getTaskExecutionCount()Retrieves current number of task executions.- Returns:
- current number of task executions.
-
findAll
org.springframework.data.domain.Page<org.springframework.cloud.task.repository.TaskExecution> findAll(org.springframework.data.domain.Pageable pageable) Retrieves all the task executions within the pageable constraints.- Parameters:
pageable- the constraints for the search- Returns:
- page containing the results from the search
-
getLatestTaskExecutionsByTaskNames
List<org.springframework.cloud.task.repository.TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames) Returns aListof the latestTaskExecutionfor 1 or more task names.Latest is defined by the most recent start time. A
TaskExecutiondoes not have to be finished (The results may including pendingTaskExecutions).It is theoretically possible that a
TaskExecutionwith the same name to have more than 1TaskExecutionfor the exact same start time. In that case theTaskExecutionwith the highest Task Execution ID is returned.This method will not consider end times in its calculations. Thus, when a task execution
Astarts after task executionBbut finishes BEFORE task executionA, then task executionBis being returned.- Parameters:
taskNames- At least 1 task name must be provided- Returns:
- List of TaskExecutions. May be empty but never null.
-
getLatestTaskExecutionForTaskName
org.springframework.cloud.task.repository.TaskExecution getLatestTaskExecutionForTaskName(String taskName) Returns the latest task execution for a given task name. Will ultimately apply the same algorithm underneath asgetLatestTaskExecutionsByTaskNames(String...)but will only return a single result.- Parameters:
taskName- Must not be null or empty- Returns:
- The latest Task Execution or null
- See Also:
-
geTaskExecutionByExecutionId
-
populateCtrStatus
-