public final class TaskInfo extends java.lang.Object implements Writeable, ToXContent
Tasks are used for communication with transport actions. As a result, they can contain callback references as well as mutable state. That makes it impractical to send tasks over transport channels and use in APIs. Instead, immutable and streamable TaskInfo objects are used to represent snapshot information about currently running tasks.
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static ConstructingObjectParser<TaskInfo,java.lang.Void> |
PARSER |
EMPTY_PARAMS
Constructor and Description |
---|
TaskInfo(StreamInput in)
Read from a stream.
|
TaskInfo(TaskId taskId,
java.lang.String type,
java.lang.String action,
java.lang.String description,
Task.Status status,
long startTime,
long runningTimeNanos,
boolean cancellable,
TaskId parentTaskId) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAction() |
java.lang.String |
getDescription() |
long |
getId() |
TaskId |
getParentTaskId()
Returns the parent task id
|
long |
getRunningTimeNanos()
Returns the task running time
|
long |
getStartTime()
Returns the task start time
|
Task.Status |
getStatus()
The status of the running task.
|
TaskId |
getTaskId() |
java.lang.String |
getType() |
int |
hashCode() |
boolean |
isCancellable()
Returns true if the task supports cancellation
|
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final ConstructingObjectParser<TaskInfo,java.lang.Void> PARSER
public TaskInfo(TaskId taskId, java.lang.String type, java.lang.String action, java.lang.String description, Task.Status status, long startTime, long runningTimeNanos, boolean cancellable, TaskId parentTaskId)
public TaskInfo(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public TaskId getTaskId()
public long getId()
public java.lang.String getType()
public java.lang.String getAction()
public java.lang.String getDescription()
public Task.Status getStatus()
public long getStartTime()
public long getRunningTimeNanos()
public boolean isCancellable()
public TaskId getParentTaskId()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object