Class AsyncTaskManagementService<Request extends TaskAwareRequest,Response extends ActionResponse,T extends StoredAsyncTask<Response>>
java.lang.Object
org.elasticsearch.xpack.esql.core.async.AsyncTaskManagementService<Request,Response,T>
public class AsyncTaskManagementService<Request extends TaskAwareRequest,Response extends ActionResponse,T extends StoredAsyncTask<Response>>
extends Object
Service for managing ESQL requests
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAsyncTaskManagementService.AsyncOperation<Request extends TaskAwareRequest,Response extends ActionResponse, T extends CancellableTask & AsyncTask> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAsyncTaskManagementService(String index, Client client, String origin, NamedWriteableRegistry registry, TaskManager taskManager, String action, AsyncTaskManagementService.AsyncOperation<Request, Response, T> operation, Class<T> taskClass, ClusterService clusterService, ThreadPool threadPool, BigArrays bigArrays) -
Method Summary
Modifier and TypeMethodDescriptionstatic <Response extends ActionResponse,Task extends StoredAsyncTask<Response>>
booleanaddCompletionListener(ThreadPool threadPool, Task task, ActionListener<StoredAsyncResponse<Response>> listener, org.elasticsearch.core.TimeValue timeout) Adds a self-unregistering listener to a task.voidasyncExecute(Request request, org.elasticsearch.core.TimeValue waitForCompletionTimeout, org.elasticsearch.core.TimeValue keepAlive, boolean keepOnCompletion, ActionListener<Response> listener)
-
Field Details
-
ASYNC_ACTION_SUFFIX
-
-
Constructor Details
-
AsyncTaskManagementService
public AsyncTaskManagementService(String index, Client client, String origin, NamedWriteableRegistry registry, TaskManager taskManager, String action, AsyncTaskManagementService.AsyncOperation<Request, Response, T> operation, Class<T> taskClass, ClusterService clusterService, ThreadPool threadPool, BigArrays bigArrays)
-
-
Method Details
-
asyncExecute
public void asyncExecute(Request request, org.elasticsearch.core.TimeValue waitForCompletionTimeout, org.elasticsearch.core.TimeValue keepAlive, boolean keepOnCompletion, ActionListener<Response> listener) -
addCompletionListener
public static <Response extends ActionResponse,Task extends StoredAsyncTask<Response>> boolean addCompletionListener(ThreadPool threadPool, Task task, ActionListener<StoredAsyncResponse<Response>> listener, org.elasticsearch.core.TimeValue timeout) Adds a self-unregistering listener to a task. It works as a normal listener except it retrieves a partial response and unregister itself from the task if timeout occurs. Returns false if the listener could not be added, if say for example the task completed. Otherwise, returns true.
-