java.lang.Object
java.lang.Record
org.elasticsearch.tasks.TaskInfo
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
public record TaskInfo(TaskId taskId, String type, String node, 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.ParamsNested 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, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTaskInfo(TaskId taskId, String type, String node, 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 aTaskInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionaction()Returns the value of theactionrecord component.booleanReturns the value of thecancellablerecord component.booleanReturns the value of thecancelledrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.static TaskInfofrom(StreamInput in) Read from a stream.static TaskInfofromXContent(XContentParser parser) final inthashCode()Returns a hash code value for this object.headers()Returns the value of theheadersrecord component.longid()node()Returns the value of thenoderecord component.Returns the value of theparentTaskIdrecord component.longReturns the value of therunningTimeNanosrecord component.longReturns the value of thestartTimerecord component.status()Returns the value of thestatusrecord component.taskId()Returns the value of thetaskIdrecord component.toString()Returns a string representation of this record class.toXContent(XContentBuilder builder, ToXContent.Params params) type()Returns the value of thetyperecord component.voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
PARSER
-
-
Constructor Details
-
TaskInfo
public TaskInfo(TaskId taskId, String type, String node, 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 aTaskInforecord class.- Parameters:
taskId- the value for thetaskIdrecord componenttype- the value for thetyperecord componentnode- the value for thenoderecord componentaction- the value for theactionrecord componentdescription- the value for thedescriptionrecord componentstatus- the value for thestatusrecord componentstartTime- the value for thestartTimerecord componentrunningTimeNanos- the value for therunningTimeNanosrecord componentcancellable- the value for thecancellablerecord componentcancelled- the value for thecancelledrecord componentparentTaskId- the value for theparentTaskIdrecord componentheaders- the value for theheadersrecord component
-
-
Method Details
-
from
Read from a stream.- Throws:
IOException
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
id
public long id() -
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin 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 thetaskIdrecord component.- Returns:
- the value of the
taskIdrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
node
Returns the value of thenoderecord component.- Returns:
- the value of the
noderecord component
-
action
Returns the value of theactionrecord component.- Returns:
- the value of the
actionrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
startTime
public long startTime()Returns the value of thestartTimerecord component.- Returns:
- the value of the
startTimerecord component
-
runningTimeNanos
public long runningTimeNanos()Returns the value of therunningTimeNanosrecord component.- Returns:
- the value of the
runningTimeNanosrecord component
-
cancellable
public boolean cancellable()Returns the value of thecancellablerecord component.- Returns:
- the value of the
cancellablerecord component
-
cancelled
public boolean cancelled()Returns the value of thecancelledrecord component.- Returns:
- the value of the
cancelledrecord component
-
parentTaskId
Returns the value of theparentTaskIdrecord component.- Returns:
- the value of the
parentTaskIdrecord component
-
headers
Returns the value of theheadersrecord component.- Returns:
- the value of the
headersrecord component
-