Class TransportCancelTasksAction
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<TasksRequest,TasksResponse>
org.elasticsearch.action.support.tasks.TransportTasksAction<CancellableTask,CancelTasksRequest,CancelTasksResponse,TaskInfo>
org.elasticsearch.action.admin.cluster.node.tasks.cancel.TransportCancelTasksAction
public class TransportCancelTasksAction
extends TransportTasksAction<CancellableTask,CancelTasksRequest,CancelTasksResponse,TaskInfo>
Transport action that can be used to cancel currently running cancellable tasks.
For a task to be cancellable it has to return an instance of
CancellableTask
from TaskAwareRequest.createTask(long, java.lang.String, java.lang.String, org.elasticsearch.tasks.TaskId, java.util.Map<java.lang.String, java.lang.String>)
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.tasks.TransportTasksAction
clusterService, requestReader, responseReader, responsesReader, transportNodeAction, transportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ConstructorDescriptionTransportCancelTasksAction(ClusterService clusterService, TransportService transportService, ActionFilters actionFilters)
-
Method Summary
Modifier and TypeMethodDescriptionprotected CancelTasksResponse
newResponse(CancelTasksRequest request, List<TaskInfo> tasks, List<TaskOperationFailure> taskOperationFailures, List<FailedNodeException> failedNodeExceptions)
protected void
processTasks(CancelTasksRequest request, Consumer<CancellableTask> operation)
protected void
taskOperation(CancelTasksRequest request, CancellableTask cancellableTask, ActionListener<TaskInfo> listener)
Perform the required operation on the task.Methods inherited from class org.elasticsearch.action.support.tasks.TransportTasksAction
doExecute, filterNodeIds, newResponse, resolveNodes
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Constructor Details
-
TransportCancelTasksAction
@Inject public TransportCancelTasksAction(ClusterService clusterService, TransportService transportService, ActionFilters actionFilters)
-
-
Method Details
-
newResponse
protected CancelTasksResponse newResponse(CancelTasksRequest request, List<TaskInfo> tasks, List<TaskOperationFailure> taskOperationFailures, List<FailedNodeException> failedNodeExceptions)- Specified by:
newResponse
in classTransportTasksAction<CancellableTask,CancelTasksRequest,CancelTasksResponse,TaskInfo>
-
processTasks
- Overrides:
processTasks
in classTransportTasksAction<CancellableTask,CancelTasksRequest,CancelTasksResponse,TaskInfo>
-
taskOperation
protected void taskOperation(CancelTasksRequest request, CancellableTask cancellableTask, ActionListener<TaskInfo> listener)Description copied from class:TransportTasksAction
Perform the required operation on the task. It is OK start an asynchronous operation or to throw an exception but not both.- Specified by:
taskOperation
in classTransportTasksAction<CancellableTask,CancelTasksRequest,CancelTasksResponse,TaskInfo>
-