Class TransportNodesAction<NodesRequest extends BaseNodesRequest<NodesRequest>,NodesResponse extends BaseNodesResponse,NodeRequest extends BaseNodeRequest,NodeResponse extends BaseNodeResponse>
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 ClusterService
protected <NodeResponse>
protected ThreadPool
protected
protected TransportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, nodeExecutor, <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
actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, nodeExecutor, finalExecutor, <NodeResponse> nodeResponseClass)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute(Task task, NodesRequest request, ActionListener<NodesResponse> listener)
protected
Get a backwards compatible transport action nameprotected abstract NodeRequest
newNodeRequest(NodesRequest request)
protected abstract NodeResponse
protected abstract NodesResponse
newResponse(NodesRequest request, <NodeResponse> responses, <FailedNodeException> failures)
Create a newTransportNodesAction
(multi-node response).protected void
newResponseAsync(Task task, NodesRequest request, <NodeResponse> responses, <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
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
threadPool
-
clusterService
-
transportService
-
nodeResponseClass
-
transportNodeAction
protected final transportNodeAction
-
-
Constructor Details
-
TransportNodesAction
protected TransportNodesAction( actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, nodeExecutor, finalExecutor, <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( actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, Writeable.Reader<NodesRequest> request, Writeable.Reader<NodeRequest> nodeRequest, nodeExecutor, <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, <NodeResponse> responses, <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:
- if any parameter is
null
.
-
newResponseAsync
protected void newResponseAsync(Task task, NodesRequest request, <NodeResponse> responses, <FailedNodeException> failures, ActionListener<NodesResponse> listener)Create a newTransportNodesAction
, possibly asynchronously. The default implementation is synchronous and callsnewResponse(BaseNodesRequest, List, List)
-
newNodeRequest
-
newNodeResponse
- Throws:
-
nodeOperation
-
nodeOperation
-
resolveRequest
resolve node ids to concrete nodes of the incoming request -
getTransportNodeAction
Get a backwards compatible transport action name
-