Package org.apache.ignite.compute.task
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 Summary
Modifier and TypeMethodDescriptionCompletableFuture<@Nullable Boolean>
changePriorityAsync
(int newPriority) Changes task priority.default CompletableFuture<@Nullable UUID>
idAsync()
Returns the id of the task.default CompletableFuture<List<@Nullable UUID>>
idsAsync()
Returns a collection of ids of the jobs which are executing under this task.Returns task's execution result.CompletableFuture<@Nullable TaskState>
Returns the current state of the task.CompletableFuture<List<@Nullable JobState>>
Returns a collection of states of the jobs which are executing under this task.
-
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 containnull
values if the time for retaining job state has been exceeded.- Returns:
- A list of current states of the jobs.
-
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 containnull
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 returnnull
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
Returns the id of the task. The task state may be deleted and thus returnnull
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
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), ornull
if the task no longer exists due to exceeding the retention time limit.
-