Class TransportNodesAction<NodesRequest extends BaseNodesRequest<NodesRequest>,NodesResponse extends BaseNodesResponse<?>,NodeRequest extends BaseNodeRequest,NodeResponse extends BaseNodeResponse>
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<NodesRequest,NodesResponse>
org.elasticsearch.action.support.nodes.TransportNodesAction<NodesRequest,NodesResponse,NodeRequest,NodeResponse>
- Direct Known Subclasses:
TransportClusterStatsAction
,TransportFindDanglingIndexAction
,TransportListDanglingIndicesAction
,TransportNodesHotThreadsAction
,TransportNodesInfoAction
,TransportNodesListGatewayMetaState
,TransportNodesListGatewayStartedShards
,TransportNodesListShardStoreMetadata
,TransportNodesReloadSecureSettingsAction
,TransportNodesSnapshotsStatus
,TransportNodesStatsAction
,TransportNodesUsageAction
public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest<NodesRequest>,NodesResponse extends BaseNodesResponse<?>,NodeRequest extends BaseNodeRequest,NodeResponse extends BaseNodeResponse>
extends HandledTransportAction<NodesRequest,NodesResponse>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ClusterService
protected final Class<NodeResponse>
protected final ThreadPool
protected final String
protected final TransportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransportNodesAction
(String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, String nodeExecutor, Class<NodeResponse> nodeResponseClass) Same asTransportNodesAction(String, ThreadPool, ClusterService, TransportService, ActionFilters, Writeable.Reader, Writeable.Reader, String, String, Class)
but executes final response collection on the transport thread except for when the final node response is received from the local node, in which casenodeExecutor
is used.protected
TransportNodesAction
(String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, String nodeExecutor, String finalExecutor, Class<NodeResponse> nodeResponseClass) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(Task task, NodesRequest request, ActionListener<NodesResponse> listener) protected String
Get a backwards compatible transport action nameprotected abstract NodeRequest
newNodeRequest
(NodesRequest request) protected abstract NodeResponse
newNodeResponse
(StreamInput in, DiscoveryNode node) protected abstract NodesResponse
newResponse
(NodesRequest request, List<NodeResponse> responses, List<FailedNodeException> failures) Create a newTransportNodesAction
(multi-node response).protected void
newResponseAsync
(Task task, NodesRequest request, List<NodeResponse> responses, List<FailedNodeException> failures, ActionListener<NodesResponse> listener) Create a newTransportNodesAction
, possibly asynchronously.protected abstract NodeResponse
nodeOperation
(NodeRequest request) protected NodeResponse
nodeOperation
(NodeRequest request, Task task) protected void
resolveRequest
(NodesRequest request, ClusterState clusterState) resolve node ids to concrete nodes of the incoming requestMethods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
threadPool
-
clusterService
-
transportService
-
nodeResponseClass
-
transportNodeAction
-
-
Constructor Details
-
TransportNodesAction
protected TransportNodesAction(String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, String nodeExecutor, String finalExecutor, Class<NodeResponse> nodeResponseClass) - Parameters:
actionName
- action namethreadPool
- thread-poolclusterService
- cluster servicetransportService
- transport serviceactionFilters
- action filtersrequest
- node request writernodeRequest
- node request readernodeExecutor
- executor to execute node action onfinalExecutor
- executor to execute final collection of all responses onnodeResponseClass
- class of the node responses
-
TransportNodesAction
protected TransportNodesAction(String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, String nodeExecutor, Class<NodeResponse> nodeResponseClass) Same asTransportNodesAction(String, ThreadPool, ClusterService, TransportService, ActionFilters, Writeable.Reader, Writeable.Reader, String, String, Class)
but executes final response collection on the transport thread except for when the final node response is received from the local node, in which casenodeExecutor
is used. This constructor should only be used for actions for which the creation of the final response is fast enough to be safely executed on a transport thread.
-
-
Method Details
-
doExecute
- Specified by:
doExecute
in classTransportAction<NodesRequest extends BaseNodesRequest<NodesRequest>,
NodesResponse extends BaseNodesResponse<?>>
-
newResponse
protected abstract NodesResponse newResponse(NodesRequest request, List<NodeResponse> responses, List<FailedNodeException> failures) Create a newTransportNodesAction
(multi-node response).- Parameters:
request
- The associated request.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, List<NodeResponse> responses, List<FailedNodeException> failures, ActionListener<NodesResponse> listener) Create a newTransportNodesAction
, possibly asynchronously. The default implementation is synchronous and callsnewResponse(BaseNodesRequest, List, List)
-
newNodeRequest
-
newNodeResponse
protected abstract NodeResponse newNodeResponse(StreamInput in, DiscoveryNode node) throws IOException - Throws:
IOException
-
nodeOperation
-
nodeOperation
-
resolveRequest
resolve node ids to concrete nodes of the incoming request -
getTransportNodeAction
Get a backwards compatible transport action name
-