Package org.elasticsearch.tasks
Class TaskInfo
java.lang.Object
org.elasticsearch.tasks.TaskInfo
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentFragment
Information about a currently running task.
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 writeable TaskInfo objects are used to represent snapshot information about currently running tasks.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static TaskInfo
fromXContent
(XContentParser parser) Returns the task headerslong
getId()
Returns the parent task idlong
Returns the task running timelong
Returns the task start timeThe status of the running task.getType()
int
hashCode()
boolean
Returns true if the task supports cancellationboolean
Returns true if the task supports cancellation and has been cancelledtoString()
toXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
PARSER
-
-
Constructor Details
-
TaskInfo
-
TaskInfo
Read from a stream.- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
getTaskId
-
getId
public long getId() -
getType
-
getAction
-
getDescription
-
getStatus
The status of the running task. Only available if TaskInfos were build with the detailed flag. -
getStartTime
public long getStartTime()Returns the task start time -
getRunningTimeNanos
public long getRunningTimeNanos()Returns the task running time -
isCancellable
public boolean isCancellable()Returns true if the task supports cancellation -
isCancelled
public boolean isCancelled()Returns true if the task supports cancellation and has been cancelled -
getParentTaskId
Returns the parent task id -
getHeaders
Returns the task headers -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
fromXContent
-
toString
-
equals
-
hashCode
public int hashCode()
-