public class TaskStatus extends Object
isComplete()
false) or it may be complete (isComplete()
true).
TaskStatus objects are immutable.Modifier and Type | Field and Description |
---|---|
static int |
MAX_ERROR_MSG_LENGTH |
Constructor and Description |
---|
TaskStatus(String id,
TaskState status,
long duration,
String errorMsg,
TaskLocation location) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static TaskStatus |
failure(String taskId,
String errorMsg)
All failed task status must have a non-null error message.
|
static TaskStatus |
fromCode(String taskId,
TaskState code)
This method is deprecated for production because it does not handle the error message of failed task status properly.
|
long |
getDuration() |
String |
getErrorMsg() |
String |
getId() |
TaskLocation |
getLocation() |
TaskState |
getStatusCode() |
int |
hashCode() |
boolean |
isComplete()
Inverse of
isRunnable() . |
boolean |
isFailure()
Returned by tasks when they complete unsuccessfully.
|
boolean |
isRunnable()
Signals that a task is not yet complete, and is still runnable on a worker.
|
boolean |
isSuccess()
Returned by tasks when they spawn subtasks.
|
static TaskStatus |
running(String taskId) |
static TaskStatus |
success(String taskId) |
static TaskStatus |
success(String taskId,
String errorMsg)
Deprecated.
|
static TaskStatus |
success(String taskId,
TaskLocation location) |
String |
toString() |
TaskStatus |
withDuration(long _duration) |
TaskStatus |
withLocation(TaskLocation location) |
public static final int MAX_ERROR_MSG_LENGTH
public static TaskStatus running(String taskId)
public static TaskStatus success(String taskId)
@Deprecated public static TaskStatus success(String taskId, String errorMsg)
success(String)
instead.public static TaskStatus failure(String taskId, String errorMsg)
public static TaskStatus success(String taskId, TaskLocation location)
public static TaskStatus fromCode(String taskId, TaskState code)
success(String)
or failure(String, String)
instead.public String getId()
public TaskState getStatusCode()
public long getDuration()
public TaskLocation getLocation()
public boolean isRunnable()
public boolean isComplete()
isRunnable()
.public boolean isSuccess()
public boolean isFailure()
public TaskStatus withDuration(long _duration)
public TaskStatus withLocation(TaskLocation location)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.