Interface JobExecution<R>

Type Parameters:
R - Job result type.

public interface JobExecution<R>
Job control object, provides information about the job execution process and result, allows cancelling the job.
  • Method Details

    • resultAsync

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

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

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

      CompletableFuture<@Nullable Boolean> changePriorityAsync(int newPriority)
      Changes job priority. After priority change job will be the last in the queue of jobs 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 job is already executing or completed), or null if the job no longer exists due to exceeding the retention time limit.
    • node

      ClusterNode node()
      A cluster node on which this job is executing.
      Returns:
      Node instance.