Package org.gridgain.internal.recovery
Class AssignedPrimaryReplicaAwaiter
java.lang.Object
org.gridgain.internal.recovery.AssignedPrimaryReplicaAwaiter
Waits until the primary replica of a partition is one of the nodes that host the partition.
Recovered rows are written into the local storages of the nodes listed in the stable assignments, bypassing replication. A primary replica outside those assignments holds a copy that recovery does not fill in, and a read addressed to it misses the recovered rows without reporting an error.
The two views converge on their own: a lease stops being prolonged once its holder leaves the assignments, and the next lease is granted to an assigned node.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAssignedPrimaryReplicaAwaiter(org.apache.ignite.internal.placementdriver.PlacementDriver placementDriver, org.apache.ignite.internal.hlc.HybridClock clock) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionawaitAssignedPrimaryReplicas(Collection<org.apache.ignite.internal.replicator.ZonePartitionId> partitionIds, long timeout, TimeUnit unit) Waits until every given partition has a primary replica that is present in the partition's stable assignments.
-
Constructor Details
-
AssignedPrimaryReplicaAwaiter
public AssignedPrimaryReplicaAwaiter(org.apache.ignite.internal.placementdriver.PlacementDriver placementDriver, org.apache.ignite.internal.hlc.HybridClock clock) Constructor.
-
-
Method Details
-
awaitAssignedPrimaryReplicas
public CompletableFuture<Void> awaitAssignedPrimaryReplicas(Collection<org.apache.ignite.internal.replicator.ZonePartitionId> partitionIds, long timeout, TimeUnit unit) Waits until every given partition has a primary replica that is present in the partition's stable assignments.- Parameters:
partitionIds- Partitions to wait for.timeout- Time to wait.unit- Unit of the time to wait.- Returns:
- Future that completes when all the given partitions have such a primary replica. Fails with
PrimaryReplicaAwaitTimeoutExceptionif the timeout elapses.
-