Class TransportBroadcastAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse,ShardRequest extends BroadcastShardRequest,ShardResponse extends BroadcastShardResponse>
- java.lang.Object
-
- org.elasticsearch.common.component.AbstractComponent
-
- org.elasticsearch.action.support.TransportAction<Request,Response>
-
- org.elasticsearch.action.support.HandledTransportAction<Request,Response>
-
- org.elasticsearch.action.support.broadcast.TransportBroadcastAction<Request,Response,ShardRequest,ShardResponse>
-
- Direct Known Subclasses:
TransportValidateQueryAction
public abstract class TransportBroadcastAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse,ShardRequest extends BroadcastShardRequest,ShardResponse extends BroadcastShardResponse> extends HandledTransportAction<Request,Response>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
TransportBroadcastAction.AsyncBroadcastAction
-
Field Summary
Fields Modifier and Type Field Description protected ClusterService
clusterService
protected TransportService
transportService
-
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, indexNameExpressionResolver, taskManager, threadPool
-
Fields inherited from class org.elasticsearch.common.component.AbstractComponent
logger
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransportBroadcastAction(Settings settings, java.lang.String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request, java.util.function.Supplier<ShardRequest> shardRequest, java.lang.String shardExecutor)
-
Method Summary
Modifier and Type Method Description protected void
asyncShardOperation(ShardRequest request, Task task, ActionListener<ShardResponse> listener)
protected abstract ClusterBlockException
checkGlobalBlock(ClusterState state, Request request)
protected abstract ClusterBlockException
checkRequestBlock(ClusterState state, Request request, java.lang.String[] concreteIndices)
protected void
doExecute(Task task, Request request, ActionListener<Response> listener)
protected void
doExecute(Request request, ActionListener<Response> listener)
protected java.lang.String
getExecutor(ShardRequest request)
protected abstract Response
newResponse(Request request, java.util.concurrent.atomic.AtomicReferenceArray shardsResponses, ClusterState clusterState)
protected abstract ShardRequest
newShardRequest(int numShards, ShardRouting shard, Request request)
protected abstract ShardResponse
newShardResponse()
protected abstract ShardResponse
shardOperation(ShardRequest request, Task task)
protected abstract GroupShardsIterator<ShardIterator>
shards(ClusterState clusterState, Request request, java.lang.String[] concreteIndices)
Determines the shards this operation will be executed on.-
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute, execute
-
-
-
-
Field Detail
-
clusterService
protected final ClusterService clusterService
-
transportService
protected final TransportService transportService
-
-
Constructor Detail
-
TransportBroadcastAction
protected TransportBroadcastAction(Settings settings, java.lang.String actionName, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, java.util.function.Supplier<Request> request, java.util.function.Supplier<ShardRequest> shardRequest, java.lang.String shardExecutor)
-
-
Method Detail
-
doExecute
protected void doExecute(Task task, Request request, ActionListener<Response> listener)
- Overrides:
doExecute
in classTransportAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse>
-
doExecute
protected final void doExecute(Request request, ActionListener<Response> listener)
- Specified by:
doExecute
in classTransportAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse>
-
newResponse
protected abstract Response newResponse(Request request, java.util.concurrent.atomic.AtomicReferenceArray shardsResponses, ClusterState clusterState)
-
newShardRequest
protected abstract ShardRequest newShardRequest(int numShards, ShardRouting shard, Request request)
-
newShardResponse
protected abstract ShardResponse newShardResponse()
-
shardOperation
protected abstract ShardResponse shardOperation(ShardRequest request, Task task) throws java.io.IOException
- Throws:
java.io.IOException
-
shards
protected abstract GroupShardsIterator<ShardIterator> shards(ClusterState clusterState, Request request, java.lang.String[] concreteIndices)
Determines the shards this operation will be executed on. The operation is executed once per shard iterator, typically on the first shard in it. If the operation fails, it will be retried on the next shard in the iterator.
-
checkGlobalBlock
protected abstract ClusterBlockException checkGlobalBlock(ClusterState state, Request request)
-
checkRequestBlock
protected abstract ClusterBlockException checkRequestBlock(ClusterState state, Request request, java.lang.String[] concreteIndices)
-
asyncShardOperation
protected void asyncShardOperation(ShardRequest request, Task task, ActionListener<ShardResponse> listener)
-
getExecutor
protected java.lang.String getExecutor(ShardRequest request)
-
-