Class TaskStatus


  • public class TaskStatus
    extends Object
    Represents the status of a task from the perspective of the coordinator. The task may be ongoing (isComplete() false) or it may be complete (isComplete() true). TaskStatus objects are immutable.
    • Method Detail

      • failure

        public static TaskStatus failure​(String taskId,
                                         String errorMsg)
        All failed task status must have a non-null error message.
      • getId

        public String getId()
      • getStatusCode

        public TaskState getStatusCode()
      • getDuration

        public long getDuration()
      • isRunnable

        public boolean isRunnable()
        Signals that a task is not yet complete, and is still runnable on a worker. Exactly one of isRunnable, isSuccess, or isFailure will be true at any one time.
        Returns:
        whether the task is runnable.
      • isComplete

        public boolean isComplete()
        Inverse of isRunnable().
        Returns:
        whether the task is complete.
      • isSuccess

        public boolean isSuccess()
        Returned by tasks when they spawn subtasks. Exactly one of isRunnable, isSuccess, or isFailure will be true at any one time.
        Returns:
        whether the task succeeded.
      • isFailure

        public boolean isFailure()
        Returned by tasks when they complete unsuccessfully. Exactly one of isRunnable, isSuccess, or isFailure will be true at any one time.
        Returns:
        whether the task failed
      • withDuration

        public TaskStatus withDuration​(long _duration)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object