Interface ReplicaPlan.Shared<E extends Endpoints<E>,​P extends ReplicaPlan<E,​P>>

  • All Superinterfaces:
    java.util.function.Supplier<P>
    All Known Implementing Classes:
    ReplicaPlan.SharedForRangeRead, ReplicaPlan.SharedForTokenRead
    Enclosing interface:
    ReplicaPlan<E extends Endpoints<E>,​P extends ReplicaPlan<E,​P>>

    public static interface ReplicaPlan.Shared<E extends Endpoints<E>,​P extends ReplicaPlan<E,​P>>
    extends java.util.function.Supplier<P>
    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. TODO: there's no reason this couldn't be achieved instead by a ReplicaPlan with mutable contacts, simplifying the hierarchy
    • 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 reference
      P get()
      get the shared replica plan, non-volatile (so maybe stale) but no risk of partially initialised
    • Method Detail

      • addToContacts

        void addToContacts​(Replica replica)
        add the provided replica to this shared plan, by updating the internal reference
      • get

        P get()
        get the shared replica plan, non-volatile (so maybe stale) but no risk of partially initialised
        Specified by:
        get in interface java.util.function.Supplier<E extends Endpoints<E>>