Class TaskResourceInfo
java.lang.Object
org.opensearch.core.tasks.resourcetracker.TaskResourceInfo
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentObject
@PublicApi(since="2.15.0")
public class TaskResourceInfo
extends Object
implements Writeable, ToXContentObject
Task resource usage information with minimal information about the task
Writeable TaskResourceInfo objects are used to represent resource usage information of running tasks, which can be propagated to coordinator node to infer query-level resource usage
- Opensearch.api:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.core.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.WriteableRegistry, Writeable.Writer<V> -
Field Summary
FieldsFields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionTaskResourceInfo(String action, long taskId, long parentTaskId, String nodeId, TaskResourceUsage taskResourceUsage) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet task actionGet node idlongGet parent task idlongGet task idGet TaskResourceUsageinthashCode()static TaskResourceInfoRead task info from a stream.toString()toXContent(XContentBuilder builder, ToXContent.Params params) 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.opensearch.core.xcontent.ToXContentObject
isFragment
-
Field Details
-
PARSER
-
-
Constructor Details
-
TaskResourceInfo
public TaskResourceInfo(String action, long taskId, long parentTaskId, String nodeId, TaskResourceUsage taskResourceUsage)
-
-
Method Details
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
readFromStream
Read task info from a stream.- Parameters:
in- StreamInput to read- Returns:
TaskResourceInfo- Throws:
IOException- IOException
-
getTaskResourceUsage
Get TaskResourceUsage- Returns:
- taskResourceUsage
-
getParentTaskId
public long getParentTaskId()Get parent task id- Returns:
- parent task id
-
getTaskId
public long getTaskId()Get task id- Returns:
- task id
-
getNodeId
Get node id- Returns:
- node id
-
getAction
Get task action- Returns:
- task action
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toString
-
equals
-
hashCode
public int hashCode()
-