public class TaskInfo extends Object implements Writeable<TaskInfo>, 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.
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsEMPTY_PARAMS| Constructor and Description |
|---|
TaskInfo(DiscoveryNode node,
long id,
String type,
String action,
String description,
Task.Status status,
long startTime,
long runningTimeNanos,
TaskId parentTaskId) |
TaskInfo(StreamInput in) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAction() |
String |
getDescription() |
long |
getId() |
DiscoveryNode |
getNode() |
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() |
String |
getType() |
TaskInfo |
readFrom(StreamInput in)
Reads a copy of an object with the same type form the stream input
The caller object remains unchanged.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Writes the current object into the output stream out
|
public TaskInfo(DiscoveryNode node, long id, String type, String action, String description, Task.Status status, long startTime, long runningTimeNanos, TaskId parentTaskId)
public TaskInfo(StreamInput in) throws IOException
IOExceptionpublic TaskId getTaskId()
public DiscoveryNode getNode()
public long getId()
public String getType()
public String getAction()
public String getDescription()
public Task.Status getStatus()
public long getStartTime()
public long getRunningTimeNanos()
public TaskId getParentTaskId()
public TaskInfo readFrom(StreamInput in) throws IOException
StreamableReaderreadFrom in interface StreamableReader<TaskInfo>IOExceptionpublic void writeTo(StreamOutput out) throws IOException
WriteablewriteTo in interface Writeable<TaskInfo>IOExceptionpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
toXContent in interface ToXContentIOExceptionCopyright © 2009–2017. All rights reserved.