Module org.elasticsearch.server
Class ReplicationRequestSplitHelper
java.lang.Object
org.elasticsearch.action.support.replication.ReplicationRequestSplitHelper
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends ReplicationRequest<T>>
Tuple<ReplicationResponse, Exception> combineSplitResponses(T originalRequest, Map<ShardId, T> splitRequests, Map<ShardId, Tuple<ReplicationResponse, Exception>> responses) static <T extends ReplicationRequest<T>>
Map<ShardId, T> splitRequest(T request, ProjectMetadata project, BiFunction<ShardId, SplitShardCountSummary, T> targetRequestFactory) Given a stale Replication Request, like flush or refresh, split it into multiple requests, one for the source shard and one for the target shard.
-
Method Details
-
splitRequest
public static <T extends ReplicationRequest<T>> Map<ShardId,T> splitRequest(T request, ProjectMetadata project, BiFunction<ShardId, SplitShardCountSummary, T> targetRequestFactory) Given a stale Replication Request, like flush or refresh, split it into multiple requests, one for the source shard and one for the target shard. SeeShardBulkSplitHelperfor how we splitBulkShardRequestWe are here because there was a mismatch between the SplitShardCountSummary in the request and that on the primary shard node. TODO: We assume here that the request is exactly 1 reshard split behind the current state. We might either revise this assumption or enforce it in a follow up -
combineSplitResponses
public static <T extends ReplicationRequest<T>> Tuple<ReplicationResponse,Exception> combineSplitResponses(T originalRequest, Map<ShardId, T> splitRequests, Map<ShardId, Tuple<ReplicationResponse, Exception>> responses)
-