Interface TaskExecution<R>

Type Parameters:
R - Task result type.

public interface TaskExecution<R>
Compute task control object. Methods inherited from the JobExecution allows control of the task coordination job.
  • Method Details

    • statesAsync

      CompletableFuture<List<@Nullable JobState>> statesAsync()
      Returns a collection of states of the jobs which are executing under this task. The resulting future is completed only after the jobs are submitted for execution. The list could contain null values if the time for retaining job state has been exceeded.
      Returns:
      A list of current states of the jobs.
    • idsAsync

      default CompletableFuture<List<@Nullable UUID>> idsAsync()
      Returns a collection of ids of the jobs which are executing under this task. The resulting future is completed only after the jobs are submitted for execution. The list could contain null values if the time for retaining job state has been exceeded.
      Returns:
      A list of ids of the jobs.
    • resultAsync

      CompletableFuture<R> resultAsync()
      Returns task's execution result.
      Returns:
      Task's execution result future.
    • stateAsync

      CompletableFuture<@Nullable TaskState> stateAsync()
      Returns the current state of the task. The task state may be deleted and thus return null if the time for retaining task state has been exceeded.
      Returns:
      The current state of the task, or null if the task state no longer exists due to exceeding the retention time limit.
    • idAsync

      default CompletableFuture<@Nullable UUID> idAsync()
      Returns the id of the task. The task state may be deleted and thus return null if the time for retaining task state has been exceeded.
      Returns:
      The id of the task, or null if the task state no longer exists due to exceeding the retention time limit.
    • changePriorityAsync

      CompletableFuture<@Nullable Boolean> changePriorityAsync(int newPriority)
      Changes task priority. After priority change task will be the last in the queue of tasks with the same priority.
      Parameters:
      newPriority - new priority.
      Returns:
      The future which will be completed with true when the priority is changed, false when the priority couldn't be changed (if the task is already executing or completed), or null if the task no longer exists due to exceeding the retention time limit.