Module org.elasticsearch.server
Class TransportNodesAction<NodesRequest extends BaseNodesRequest,NodesResponse extends BaseNodesResponse<?>,NodeRequest extends TransportRequest,NodeResponse extends BaseNodeResponse,ActionContext>
java.lang.Object
org.elasticsearch.action.support.TransportAction<NodesRequest,NodesResponse>
org.elasticsearch.action.support.nodes.TransportNodesAction<NodesRequest,NodesResponse,NodeRequest,NodeResponse,ActionContext>
- Direct Known Subclasses:
HealthApiStatsTransportAction,IndexModeStatsActionType.TransportAction,TransportClusterStatsAction,TransportFindDanglingIndexAction,TransportListDanglingIndicesAction,TransportNodesCapabilitiesAction,TransportNodesFeaturesAction,TransportNodesHotThreadsAction,TransportNodesInfoAction,TransportNodesListGatewayStartedShards,TransportNodesListShardStoreMetadata,TransportNodesReloadSecureSettingsAction,TransportNodesSnapshotsStatus,TransportNodesStatsAction,TransportNodesUsageAction,TransportNodeUsageStatsForThreadPoolsAction,TransportPrevalidateShardPathAction
public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest,NodesResponse extends BaseNodesResponse<?>,NodeRequest extends TransportRequest,NodeResponse extends BaseNodeResponse,ActionContext>
extends TransportAction<NodesRequest,NodesResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClusterServiceprotected final Stringprotected final TransportServiceFields inherited from class org.elasticsearch.action.support.TransportAction
actionName, taskManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTransportNodesAction(String actionName, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodeRequest> nodeRequest, Executor executor) -
Method Summary
Modifier and TypeMethodDescriptionprotected ActionContextcreateActionContext(Task task, NodesRequest request) Create an (optional)TransportNodesAction: called when starting to execute this action, and the result passed tonewResponseAsync(org.elasticsearch.tasks.Task, NodesRequest, ActionContext, java.util.List<NodeResponse>, java.util.List<org.elasticsearch.action.FailedNodeException>, org.elasticsearch.action.ActionListener<NodesResponse>)on completion.protected voiddoExecute(Task task, NodesRequest request, ActionListener<NodesResponse> listener) protected abstract NodeRequestnewNodeRequest(NodesRequest request) protected abstract NodeResponsenewNodeResponse(StreamInput in, DiscoveryNode node) protected abstract NodesResponsenewResponse(NodesRequest request, List<NodeResponse> responses, List<FailedNodeException> failures) Create a newTransportNodesAction.protected voidnewResponseAsync(Task task, NodesRequest request, ActionContext actionContext, List<NodeResponse> responses, List<FailedNodeException> failures, ActionListener<NodesResponse> listener) Create a newTransportNodesAction, possibly asynchronously.protected abstract NodeResponsenodeOperation(NodeRequest request, Task task) Implements the request recipient logic.protected voidnodeOperationAsync(NodeRequest request, Task task, ActionListener<NodeResponse> listener) This method can be overridden if a subclass needs to access to a listener in order to asynchronously respond to the node request.protected DiscoveryNode[]resolveRequest(NodesRequest request, ClusterState clusterState) Resolves node ids to concrete nodes of the incoming request.Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, executeDirect, localOnly
-
Field Details
-
clusterService
-
transportService
-
transportNodeAction
-
-
Constructor Details
-
TransportNodesAction
protected TransportNodesAction(String actionName, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodeRequest> nodeRequest, Executor executor) - Parameters:
actionName- action nameclusterService- cluster servicetransportService- transport serviceactionFilters- action filtersnodeRequest- node request readerexecutor- executor to execute node action and final collection
-
-
Method Details
-
doExecute
- Specified by:
doExecutein classTransportAction<NodesRequest extends BaseNodesRequest,NodesResponse extends BaseNodesResponse<?>>
-
createActionContext
Create an (optional)TransportNodesAction: called when starting to execute this action, and the result passed tonewResponseAsync(org.elasticsearch.tasks.Task, NodesRequest, ActionContext, java.util.List<NodeResponse>, java.util.List<org.elasticsearch.action.FailedNodeException>, org.elasticsearch.action.ActionListener<NodesResponse>)on completion. NB runs on the transport worker thread, must not do anything expensive without dispatching to a different executor. -
newResponse
protected abstract NodesResponse newResponse(NodesRequest request, List<NodeResponse> responses, List<FailedNodeException> failures) Create a newTransportNodesAction. This method is executed onfinalExecutor.- Parameters:
request- The request whose response we are constructing.TransportNodesActionmay have already released all its references to this object before calling this method, so it's up to individual implementations to retain their own reference to the request if still needed here.responses- All successful node-level responses.failures- All node-level failures.- Returns:
- Never
null. - Throws:
NullPointerException- if any parameter isnull.
-
newResponseAsync
protected void newResponseAsync(Task task, NodesRequest request, ActionContext actionContext, List<NodeResponse> responses, List<FailedNodeException> failures, ActionListener<NodesResponse> listener) Create a newTransportNodesAction, possibly asynchronously. The default implementation is synchronous and callsnewResponse(BaseNodesRequest, List, List). This method is executed onfinalExecutor.- Parameters:
request- The request whose response we are constructing.TransportNodesActionmay have already released all its references to this object before calling this method, so it's up to individual implementations to retain their own reference to the request if still needed here.
-
newNodeRequest
-
newNodeResponse
protected abstract NodeResponse newNodeResponse(StreamInput in, DiscoveryNode node) throws IOException - Throws:
IOException
-
nodeOperation
Implements the request recipient logic. If access to the request listener is needed, overridenodeOperationAsync(TransportRequest, Task, ActionListener). -
nodeOperationAsync
protected void nodeOperationAsync(NodeRequest request, Task task, ActionListener<NodeResponse> listener) This method can be overridden if a subclass needs to access to a listener in order to asynchronously respond to the node request. The default implementation is to fall through tonodeOperation(NodeRequest, org.elasticsearch.tasks.Task). -
resolveRequest
Resolves node ids to concrete nodes of the incoming request. NB: if the request's nodeIds() returns nothing, then the request will be sent to ALL known nodes in the cluster.
-