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 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

      long getTaskExecutionCountByTaskName(String taskName)
      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

      long getCompletedTaskExecutionCountByTaskNameAndBeforeDate(String taskName, @NonNull Date endTime)
      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 task
      endTime - the time before task ended
      Returns:
      the number of completed task executions
    • getCompletedTaskExecutionCountByTaskName

      long getCompletedTaskExecutionCountByTaskName(String taskName)
      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

      long getRunningTaskExecutionCountByTaskName(String taskName)
      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 a List of the latest TaskExecution for 1 or more task names.

      Latest is defined by the most recent start time. A TaskExecution does not have to be finished (The results may including pending TaskExecutions).

      It is theoretically possible that a TaskExecution with the same name to have more than 1 TaskExecution for the exact same start time. In that case the TaskExecution with the highest Task Execution ID is returned.

      This method will not consider end times in its calculations. Thus, when a task execution A starts after task execution B but finishes BEFORE task execution A, then task execution B is 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 as getLatestTaskExecutionsByTaskNames(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

      org.springframework.cloud.task.repository.TaskExecution geTaskExecutionByExecutionId(String executionId, String taskName)
    • populateCtrStatus

      void populateCtrStatus(Collection<ThinTaskExecution> thinTaskExecutions)