public class Task
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Task.Status |
Constructor and Description |
---|
Task(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTask) |
Task(long id,
java.lang.String type,
java.lang.String action,
java.lang.String description,
TaskId parentTask,
long startTime,
long startTimeNanos) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAction()
Returns task action
|
java.lang.String |
getDescription()
Generates task description
|
long |
getId()
Returns task id
|
TaskId |
getParentTaskId()
Returns id of the parent task or NO_PARENT_ID if the task doesn't have any parent tasks
|
long |
getStartTime()
Returns the task start time
|
Task.Status |
getStatus()
Build a status for this task or null if this task doesn't have status.
|
java.lang.String |
getType()
Returns task channel type (netty, transport, direct)
|
PersistedTaskInfo |
result(DiscoveryNode node,
ActionResponse response) |
PersistedTaskInfo |
result(DiscoveryNode node,
java.lang.Throwable error) |
TaskInfo |
taskInfo(DiscoveryNode node,
boolean detailed)
Build a version of the task status you can throw over the wire and back
to the user.
|
public Task(long id, java.lang.String type, java.lang.String action, java.lang.String description, TaskId parentTask)
public Task(long id, java.lang.String type, java.lang.String action, java.lang.String description, TaskId parentTask, long startTime, long startTimeNanos)
public TaskInfo taskInfo(DiscoveryNode node, boolean detailed)
node
- the node this task is running ondetailed
- should the information include detailed, potentially slow to
generate data?public long getId()
public java.lang.String getType()
public java.lang.String getAction()
public java.lang.String getDescription()
public long getStartTime()
public TaskId getParentTaskId()
public Task.Status getStatus()
public PersistedTaskInfo result(DiscoveryNode node, java.lang.Throwable error) throws java.io.IOException
java.io.IOException
public PersistedTaskInfo result(DiscoveryNode node, ActionResponse response) throws java.io.IOException
java.io.IOException