Package org.apache.cassandra.locator
Interface ReplicaPlan.Shared<E extends Endpoints<E>,P extends ReplicaPlan<E>>
-
- All Known Implementing Classes:
ReplicaPlan.SharedForRangeRead
,ReplicaPlan.SharedForTokenRead
- Enclosing class:
- ReplicaPlan<E extends Endpoints<E>>
public static interface ReplicaPlan.Shared<E extends Endpoints<E>,P extends ReplicaPlan<E>>
Used by AbstractReadExecutor, {Data,Digest}Resolver and ReadRepair to share a ReplicaPlan whose 'contacts' replicas we progressively modify via various forms of speculation (initial speculation, rr-read and rr-write) The internal reference is not volatile, despite being shared between threads. The initial reference provided to the constructor should be visible by the normal process of sharing data between threads (i.e. executors, etc) and any updates will either be seen or not seen, perhaps not promptly, but certainly not incompletely. The contained ReplicaPlan has only final member properties, so it cannot be seen partially initialised.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addToContacts(Replica replica)
add the provided replica to this shared plan, by updating the internal referenceP
get()
get the shared replica plan, non-volatile (so maybe stale) but no risk of partially initialisedP
getWithContacts(E endpoints)
get the shared replica plan, non-volatile (so maybe stale) but no risk of partially initialised, but replace its 'contacts' with those provided
-