java.lang.Object
java.lang.Record
org.elasticsearch.tasks.TaskInfo
- All Implemented Interfaces:
Writeable
,ToXContent
,ToXContentFragment
public record TaskInfo(TaskId taskId, String type, String action, String description, Task.Status status, long startTime, long runningTimeNanos, boolean cancellable, boolean cancelled, TaskId parentTaskId, Map<String,String> headers)
extends Record
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.
-
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
FieldsFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()
Returns the value of theaction
record component.boolean
Returns the value of thecancellable
record component.boolean
Returns the value of thecancelled
record component.Returns the value of thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.static TaskInfo
from
(StreamInput in) Read from a stream.static TaskInfo
fromXContent
(XContentParser parser) final int
hashCode()
Returns a hash code value for this object.headers()
Returns the value of theheaders
record component.long
id()
Returns the value of theparentTaskId
record component.long
Returns the value of therunningTimeNanos
record component.long
Returns the value of thestartTime
record component.status()
Returns the value of thestatus
record component.taskId()
Returns the value of thetaskId
record component.toString()
Returns a string representation of this record class.toXContent
(XContentBuilder builder, ToXContent.Params params) type()
Returns the value of thetype
record component.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
public TaskInfo(TaskId taskId, String type, String action, String description, Task.Status status, long startTime, long runningTimeNanos, boolean cancellable, boolean cancelled, TaskId parentTaskId, Map<String, String> headers) Creates an instance of aTaskInfo
record class.- Parameters:
taskId
- the value for thetaskId
record componenttype
- the value for thetype
record componentaction
- the value for theaction
record componentdescription
- the value for thedescription
record componentstatus
- the value for thestatus
record componentstartTime
- the value for thestartTime
record componentrunningTimeNanos
- the value for therunningTimeNanos
record componentcancellable
- the value for thecancellable
record componentcancelled
- the value for thecancelled
record componentparentTaskId
- the value for theparentTaskId
record componentheaders
- the value for theheaders
record component
-
-
Method Details
-
from
Read from a stream.- Throws:
IOException
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
id
public long id() -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
fromXContent
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
taskId
Returns the value of thetaskId
record component.- Returns:
- the value of the
taskId
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
action
Returns the value of theaction
record component.- Returns:
- the value of the
action
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
status
Returns the value of thestatus
record component.- Returns:
- the value of the
status
record component
-
startTime
public long startTime()Returns the value of thestartTime
record component.- Returns:
- the value of the
startTime
record component
-
runningTimeNanos
public long runningTimeNanos()Returns the value of therunningTimeNanos
record component.- Returns:
- the value of the
runningTimeNanos
record component
-
cancellable
public boolean cancellable()Returns the value of thecancellable
record component.- Returns:
- the value of the
cancellable
record component
-
cancelled
public boolean cancelled()Returns the value of thecancelled
record component.- Returns:
- the value of the
cancelled
record component
-
parentTaskId
Returns the value of theparentTaskId
record component.- Returns:
- the value of the
parentTaskId
record component
-
headers
Returns the value of theheaders
record component.- Returns:
- the value of the
headers
record component
-