Package org.opensearch.action.search
Class SearchTask
java.lang.Object
org.opensearch.tasks.Task
org.opensearch.tasks.CancellableTask
org.opensearch.action.search.SearchTask
Task storing information about a currently running
SearchRequest
.- Opensearch.internal:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensearch.tasks.Task
Task.Status
-
Field Summary
Fields inherited from class org.opensearch.tasks.Task
X_OPAQUE_ID
-
Constructor Summary
ConstructorsConstructorDescriptionSearchTask
(long id, String type, String action, Supplier<String> descriptionSupplier, TaskId parentTaskId, Map<String, String> headers) SearchTask
(long id, String type, String action, Supplier<String> descriptionSupplier, TaskId parentTaskId, Map<String, String> headers, org.opensearch.common.unit.TimeValue cancelAfterTimeInterval) -
Method Summary
Modifier and TypeMethodDescriptionfinal String
Generates task descriptionfinal SearchProgressListener
Return theSearchProgressListener
attached to this task.final void
setProgressListener
(SearchProgressListener progressListener) Attach aSearchProgressListener
to this task.boolean
Returns true if this task can potentially have children that need to be cancelled when it parent is cancelled.boolean
Individual tasks can override this if they want to support task resource tracking.Methods inherited from class org.opensearch.tasks.CancellableTask
cancelOnParentLeaving, getCancellationTimeout, getReasonCancelled, isCancelled, onCancelled
Methods inherited from class org.opensearch.tasks.Task
addResourceTrackingCompletionListener, decrementResourceTrackingThreads, getAction, getHeader, getId, getParentTaskId, getResourceStats, getStartTime, getStartTimeNanos, getStatus, getTotalResourceStats, getTotalResourceUtilization, getType, incrementResourceTrackingThreads, result, result, startThreadResourceTracking, stopThreadResourceTracking, taskInfo, taskInfo, taskInfo, updateThreadResourceStats
-
Constructor Details
-
SearchTask
-
SearchTask
-
-
Method Details
-
getDescription
Description copied from class:Task
Generates task description- Overrides:
getDescription
in classTask
-
supportsResourceTracking
public boolean supportsResourceTracking()Description copied from class:Task
Individual tasks can override this if they want to support task resource tracking. We just need to make sure that the ThreadPool on which the task runs on have runnable wrapper similar toOpenSearchExecutors.newAutoQueueFixed(java.lang.String, int, int, int, int, int, org.opensearch.common.unit.TimeValue, java.util.concurrent.ThreadFactory, org.opensearch.common.util.concurrent.ThreadContext)
- Overrides:
supportsResourceTracking
in classTask
- Returns:
- true if resource tracking is supported by the task
-
setProgressListener
Attach aSearchProgressListener
to this task. -
getProgressListener
Return theSearchProgressListener
attached to this task. -
shouldCancelChildrenOnCancellation
public boolean shouldCancelChildrenOnCancellation()Description copied from class:CancellableTask
Returns true if this task can potentially have children that need to be cancelled when it parent is cancelled.- Specified by:
shouldCancelChildrenOnCancellation
in classCancellableTask
-