Class TransportTasksAction<OperationTask extends Task,TasksRequest extends BaseTasksRequest<TasksRequest>,TasksResponse extends BaseTasksResponse,TaskResponse extends Writeable>
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<TasksRequest,TasksResponse>
org.elasticsearch.action.support.tasks.TransportTasksAction<OperationTask,TasksRequest,TasksResponse,TaskResponse>
- Direct Known Subclasses:
TransportCancelTasksAction
,TransportListTasksAction
public abstract class TransportTasksAction<OperationTask extends Task,TasksRequest extends BaseTasksRequest<TasksRequest>,TasksResponse extends BaseTasksResponse,TaskResponse extends Writeable>
extends HandledTransportAction<TasksRequest,TasksResponse>
The base class for transport actions that are interacting with currently running tasks.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ClusterService
protected Writeable.Reader<TasksRequest>
protected Writeable.Reader<TaskResponse>
protected Writeable.Reader<TasksResponse>
protected String
protected TransportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransportTasksAction(String actionName, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<TasksRequest> requestReader, Writeable.Reader<TasksResponse> responsesReader, Writeable.Reader<TaskResponse> responseReader, String nodeExecutor)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute(Task task, TasksRequest request, ActionListener<TasksResponse> listener)
protected String[]
filterNodeIds(DiscoveryNodes nodes, String[] nodesIds)
protected TasksResponse
newResponse(TasksRequest request, AtomicReferenceArray responses)
protected abstract TasksResponse
newResponse(TasksRequest request, List<TaskResponse> tasks, List<TaskOperationFailure> taskOperationFailures, List<FailedNodeException> failedNodeExceptions)
protected void
processTasks(TasksRequest request, Consumer<OperationTask> operation)
protected String[]
resolveNodes(TasksRequest request, ClusterState clusterState)
protected abstract void
taskOperation(TasksRequest request, OperationTask task, ActionListener<TaskResponse> listener)
Perform the required operation on the task.Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
clusterService
-
transportService
-
requestReader
-
responsesReader
-
responseReader
-
transportNodeAction
-
-
Constructor Details
-
TransportTasksAction
protected TransportTasksAction(String actionName, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<TasksRequest> requestReader, Writeable.Reader<TasksResponse> responsesReader, Writeable.Reader<TaskResponse> responseReader, String nodeExecutor)
-
-
Method Details
-
doExecute
- Specified by:
doExecute
in classTransportAction<TasksRequest extends BaseTasksRequest<TasksRequest>,TasksResponse extends BaseTasksResponse>
-
filterNodeIds
-
resolveNodes
-
processTasks
-
newResponse
protected abstract TasksResponse newResponse(TasksRequest request, List<TaskResponse> tasks, List<TaskOperationFailure> taskOperationFailures, List<FailedNodeException> failedNodeExceptions) -
newResponse
-
taskOperation
protected abstract void taskOperation(TasksRequest request, OperationTask task, ActionListener<TaskResponse> listener)Perform the required operation on the task. It is OK start an asynchronous operation or to throw an exception but not both.
-