Class TaskInfo

org.elasticsearch.tasks.TaskInfo
All Implemented Interfaces:
Writeable, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public final class TaskInfo extends implements Writeable, org.elasticsearch.common.xcontent.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.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params

    Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable

    Writeable.Reader<V>, Writeable.Writer<V>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static org.elasticsearch.common.xcontent.ConstructingObjectParser<>
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Read from a stream.
    TaskInfo​(TaskId taskId,  type,  action,  description, Task.Status status, long startTime, long runningTimeNanos, boolean cancellable, boolean cancelled, TaskId parentTaskId, <,​> headers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     obj)
     
    static TaskInfo
    fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)
     
     
     
    <,​>
    Returns the task headers
    long
     
    Returns the parent task id
    long
    Returns the task running time
    long
    Returns the task start time
    The status of the running task.
     
     
    int
     
    boolean
    Returns true if the task supports cancellation
    boolean
    Returns true if the task supports cancellation and has been cancelled
     
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
     
    void
    Write this into the StreamOutput.

    Methods inherited from class java.lang.

    , , , , , , ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

    • PARSER

      public static final org.elasticsearch.common.xcontent.ConstructingObjectParser<> PARSER
  • Constructor Details

    • TaskInfo

      public TaskInfo(TaskId taskId,  type,  action,  description, Task.Status status, long startTime, long runningTimeNanos, boolean cancellable, boolean cancelled, TaskId parentTaskId, <,​> headers)
    • TaskInfo

      public TaskInfo(StreamInput in) throws
      Read from a stream.
      Throws:
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Throws:
    • getTaskId

      public TaskId getTaskId()
    • getId

      public long getId()
    • getType

      public  getType()
    • getAction

      public  getAction()
    • getDescription

      public  getDescription()
    • getStatus

      public Task.Status 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

      public TaskId getParentTaskId()
      Returns the parent task id
    • getHeaders

      public <,​> getHeaders()
      Returns the task headers
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
    • fromXContent

      public static TaskInfo fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
    • toString

      public  toString()
      Overrides:
       in class 
    • equals

      public boolean equals( obj)
      Overrides:
       in class 
    • hashCode

      public int hashCode()
      Overrides:
       in class