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 ClassesModifier and TypeClassDescriptionstatic interfaceReplicationSplitHelper.PrimaryRequestExecutor<Request extends ReplicationRequest<Request>,ReplicaRequest extends ReplicationRequest<ReplicaRequest>, Response extends ReplicationResponse> class -
Field Summary
Fields -
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(org.apache.logging.log4j.Logger logger, 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, ReplicationSplitHelper.PrimaryRequestExecutor<Request, ReplicaRequest, Response> executePrimaryRequest, ActionListener<Response> onCompletionListener)
-
Field Details
-
STALE_REQUEST_EXCEPTION_VERSION
-
-
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(org.apache.logging.log4j.Logger logger, Request primaryRequest, IndexMetadata indexMetadata) throws Exception - Throws:
Exception
-
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, ReplicationSplitHelper.PrimaryRequestExecutor<Request, ReplicaRequest, Response> executePrimaryRequest, ActionListener<Response> onCompletionListener)
-