Module org.elasticsearch.server
Class ReplicationSplitHelper<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>
java.lang.Object
org.elasticsearch.action.support.replication.ReplicationSplitHelper<Request,ReplicaRequest,Response>
public class ReplicationSplitHelper<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>,Response extends ReplicationResponse>
extends Object
This class implements the coordination logic during a split. If documents are only routed to the source then it will be a normal
primary action. If documents are only routed to the target it will be delegated to the target. If documents are routed to both then
the request will be split into two and executed locally and delegated to the target.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionReplicationSplitHelper(org.apache.logging.log4j.Logger logger, ClusterService clusterService, TimeValue initialRetryBackoffBound, TimeValue retryTimeout, TriConsumer<DiscoveryNode, TransportReplicationAction.ConcreteShardRequest<Request>, ActionListener<Response>> primaryRequestSender) -
Method Summary
Modifier and TypeMethodDescriptionstatic <Request extends ReplicationRequest<Request>>
booleanneedsSplitCoordination(Request primaryRequest, IndexMetadata indexMetadata) newSplitRequest(TransportReplicationAction<Request, ReplicaRequest, Response> action, ReplicationTask task, ProjectMetadata project, TransportReplicationAction<Request, ReplicaRequest, Response>.org.elasticsearch.action.support.replication.TransportReplicationAction.PrimaryShardReference primaryShardReference, Request primaryRequest, CheckedBiConsumer<TransportReplicationAction<Request, ReplicaRequest, Response>.org.elasticsearch.action.support.replication.TransportReplicationAction.PrimaryShardReference, ActionListener<Response>, Exception> executePrimaryRequest, ActionListener<Response> onCompletionListener)
-
Constructor Details
-
ReplicationSplitHelper
public ReplicationSplitHelper(org.apache.logging.log4j.Logger logger, ClusterService clusterService, TimeValue initialRetryBackoffBound, TimeValue retryTimeout, TriConsumer<DiscoveryNode, TransportReplicationAction.ConcreteShardRequest<Request>, ActionListener<Response>> primaryRequestSender)
-
-
Method Details
-
needsSplitCoordination
public static <Request extends ReplicationRequest<Request>> boolean needsSplitCoordination(Request primaryRequest, IndexMetadata indexMetadata) -
newSplitRequest
public ReplicationSplitHelper<Request,ReplicaRequest, newSplitRequestResponse>.SplitCoordinator (TransportReplicationAction<Request, ReplicaRequest, Response> action, ReplicationTask task, ProjectMetadata project, TransportReplicationAction<Request, ReplicaRequest, Response>.org.elasticsearch.action.support.replication.TransportReplicationAction.PrimaryShardReference primaryShardReference, Request primaryRequest, CheckedBiConsumer<TransportReplicationAction<Request, ReplicaRequest, Response>.org.elasticsearch.action.support.replication.TransportReplicationAction.PrimaryShardReference, ActionListener<Response>, Exception> executePrimaryRequest, ActionListener<Response> onCompletionListener)
-