Class TransportSingleShardAction<Request extends SingleShardRequest<Request>,Response extends ActionResponse>
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.single.shard.TransportSingleShardAction<Request,Response>
- Direct Known Subclasses:
RetentionLeaseActions.Add.TransportAction
,RetentionLeaseActions.Remove.TransportAction
,RetentionLeaseActions.Renew.TransportAction
,TransportAnalyzeAction
,TransportExplainAction
,TransportGetAction
,TransportGetFieldMappingsIndexAction
,TransportShardMultiGetAction
,TransportShardMultiTermsVectorAction
,TransportTermVectorsAction
public abstract class TransportSingleShardAction<Request extends SingleShardRequest<Request>,Response extends ActionResponse>
extends TransportAction<Request,Response>
A base class for operations that need to perform a read operation on a single shard copy. If the operation fails,
the read operation can be performed on other shard copies. Concrete implementations can provide their own list
of candidate shards to try the read operation on.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Internal request class that gets built on each node. -
Field Summary
Modifier and TypeFieldDescriptionprotected ClusterService
protected IndexNameExpressionResolver
protected ThreadPool
protected TransportService
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
TransportSingleShardAction(String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader<Request> request, String executor)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
asyncShardOperation(Request request, ShardId shardId, ActionListener<Response> listener)
protected ClusterBlockException
checkGlobalBlock(ClusterState state)
protected ClusterBlockException
checkRequestBlock(ClusterState state, TransportSingleShardAction.InternalRequest request)
protected void
doExecute(Task task, Request request, ActionListener<Response> listener)
protected String
getExecutor(Request request, ShardId shardId)
protected abstract Writeable.Reader<Response>
protected boolean
Tells whether the action is a main one or a subaction.protected abstract boolean
resolveIndex(Request request)
protected void
resolveRequest(ClusterState state, TransportSingleShardAction.InternalRequest request)
protected abstract Response
shardOperation(Request request, ShardId shardId)
protected abstract ShardsIterator
shards(ClusterState state, TransportSingleShardAction.InternalRequest request)
Returns the candidate shards to execute the operation on ornull
the execute the operation locally (the node that received the request)Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Field Details
-
threadPool
-
clusterService
-
transportService
-
indexNameExpressionResolver
-
-
Constructor Details
-
TransportSingleShardAction
protected TransportSingleShardAction(String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Writeable.Reader<Request> request, String executor)
-
-
Method Details
-
isSubAction
protected boolean isSubAction()Tells whether the action is a main one or a subaction. Used to decide whether we need to register the main transport handler. In fact if the action is a subaction, its execute method will be called locally to its parent action. -
doExecute
- Specified by:
doExecute
in classTransportAction<Request extends SingleShardRequest<Request>,Response extends ActionResponse>
-
shardOperation
- Throws:
IOException
-
asyncShardOperation
protected void asyncShardOperation(Request request, ShardId shardId, ActionListener<Response> listener) throws IOException- Throws:
IOException
-
getResponseReader
-
resolveIndex
-
checkGlobalBlock
-
checkRequestBlock
protected ClusterBlockException checkRequestBlock(ClusterState state, TransportSingleShardAction.InternalRequest request) -
resolveRequest
protected void resolveRequest(ClusterState state, TransportSingleShardAction.InternalRequest request) -
shards
@Nullable protected abstract ShardsIterator shards(ClusterState state, TransportSingleShardAction.InternalRequest request)Returns the candidate shards to execute the operation on ornull
the execute the operation locally (the node that received the request) -
getExecutor
-