Class TaskInfo

  • All Implemented Interfaces:
    Writeable, ToXContent, ToXContentFragment

    public final class TaskInfo
    extends java.lang.Object
    implements Writeable, 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.

    • Constructor Detail

      • TaskInfo

        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,
                        java.util.Map<java.lang.String,​java.lang.String> headers)
      • TaskInfo

        public TaskInfo​(StreamInput in)
                 throws java.io.IOException
        Read from a stream.
        Throws:
        java.io.IOException
    • Method Detail

      • getTaskId

        public TaskId getTaskId()
      • getId

        public long getId()
      • getType

        public java.lang.String getType()
      • getAction

        public java.lang.String getAction()
      • getDescription

        public java.lang.String 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
      • getParentTaskId

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

        public java.util.Map<java.lang.String,​java.lang.String> getHeaders()
        Returns the task headers
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object