Class TransportBroadcastReplicationAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse,ShardRequest extends ReplicationRequest<ShardRequest>,ShardResponse extends ReplicationResponse>
java.lang.Object
org.elasticsearch.action.support.TransportAction<Request,Response>
org.elasticsearch.action.support.HandledTransportAction<Request,Response>
org.elasticsearch.action.support.replication.TransportBroadcastReplicationAction<Request,Response,ShardRequest,ShardResponse>
- Direct Known Subclasses:
TransportFlushAction
,TransportRefreshAction
public abstract class TransportBroadcastReplicationAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse,ShardRequest extends ReplicationRequest<ShardRequest>,ShardResponse extends ReplicationResponse>
extends HandledTransportAction<Request,Response>
Base class for requests that should be executed on all shards of an index or several indices.
This action sends shard requests to all primary shards of the indices and they are then replicated like write requests
-
Field Summary
Fields inherited from class org.elasticsearch.action.support.TransportAction
actionName, localConnection, logger, taskManager
-
Constructor Summary
ConstructorDescriptionTransportBroadcastReplicationAction(String name, Writeable.Reader<Request> requestReader, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, TransportReplicationAction replicatedBroadcastShardAction)
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute(Task task, Request request, ActionListener<Response> listener)
protected abstract BroadcastResponse
newResponse(int successfulShards, int failedShards, int totalNumCopies, List<DefaultShardOperationFailedException> shardFailures)
protected abstract ShardRequest
newShardRequest(Request request, ShardId shardId)
protected abstract ShardResponse
protected void
shardExecute(Task task, Request request, ShardId shardId, ActionListener<ShardResponse> shardActionListener)
shards(Request request, ClusterState clusterState)
Methods inherited from class org.elasticsearch.action.support.TransportAction
execute, execute, execute
-
Constructor Details
-
TransportBroadcastReplicationAction
public TransportBroadcastReplicationAction(String name, Writeable.Reader<Request> requestReader, ClusterService clusterService, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, TransportReplicationAction replicatedBroadcastShardAction)
-
-
Method Details
-
doExecute
- Specified by:
doExecute
in classTransportAction<Request extends BroadcastRequest<Request>,Response extends BroadcastResponse>
-
shardExecute
protected void shardExecute(Task task, Request request, ShardId shardId, ActionListener<ShardResponse> shardActionListener) -
shards
- Returns:
- all shard ids the request should run on
-
newShardResponse
-
newShardRequest
-
newResponse
protected abstract BroadcastResponse newResponse(int successfulShards, int failedShards, int totalNumCopies, List<DefaultShardOperationFailedException> shardFailures)
-