Package org.apache.druid.indexer
Class TaskStatus
java.lang.Object
org.apache.druid.indexer.TaskStatus
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.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTaskStatus(String id, TaskState status, long duration, String errorMsg, TaskLocation location) -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic TaskStatusAll failed task status must have a non-null error message.static TaskStatusThis method is deprecated for production because it does not handle the error message of failed task status properly.longgetId()inthashCode()booleanInverse ofisRunnable().booleanReturned by tasks when they complete unsuccessfully.booleanSignals that a task is not yet complete, and is still runnable on a worker.booleanReturned by tasks when they spawn subtasks.static TaskStatusstatic TaskStatusstatic TaskStatusDeprecated.static TaskStatussuccess(String taskId, TaskLocation location) toString()withDuration(long _duration) withLocation(TaskLocation location)
-
Field Details
-
MAX_ERROR_MSG_TRUNCATION_LIMIT
public static final int MAX_ERROR_MSG_TRUNCATION_LIMIT- See Also:
-
-
Constructor Details
-
TaskStatus
public TaskStatus(String id, TaskState status, long duration, @Nullable String errorMsg, @Nullable TaskLocation location)
-
-
Method Details
-
running
-
success
-
success
Deprecated.The succeeded task status should not have error messages. Usesuccess(String)instead. -
failure
All failed task status must have a non-null error message. -
success
-
fromCode
This method is deprecated for production because it does not handle the error message of failed task status properly. Usesuccess(String)orfailure(String, String)instead. -
getId
-
getStatusCode
-
getDuration
public long getDuration() -
getErrorMsg
-
getLocation
-
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 ofisRunnable().- 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
-
withLocation
-
toString
-
equals
-
hashCode
public int hashCode()
-