Class BucketStoreActor<T extends BucketData<T>>

All Implemented Interfaces:
Actor, Stash, StashFactory, StashSupport, UnrestrictedStash, RequiresMessageQueue<DequeBasedMessageQueueSemantics>, AbstractPersistentActorLike, Eventsourced, PersistenceIdentity, PersistenceRecovery, PersistenceStash, Snapshotter, ExecuteInSelfActor
Direct Known Subclasses:
ActionRegistry, RpcRegistry

public abstract class BucketStoreActor<T extends BucketData<T>> extends AbstractUntypedPersistentActorWithMetering
A store that syncs its data across nodes in the cluster. It maintains a Bucket per node. Buckets are versioned. A node can write ONLY to its bucket. This way, write conflicts are avoided.

Buckets are sync'ed across nodes using Gossip protocol (http://en.wikipedia.org/wiki/Gossip_protocol). This store uses a Gossiper.

  • Constructor Details

  • Method Details

    • getLocalData

      public final T getLocalData()
    • getRemoteBuckets

      public final Map<Address,Bucket<T>> getRemoteBuckets()
    • getVersions

      public final Map<Address,Long> getVersions()
    • persistenceId

      public final String persistenceId()
    • preStart

      public void preStart()
      Specified by:
      preStart in interface Actor
      Overrides:
      preStart in class AbstractActor
    • handleCommand

      protected void handleCommand(Object message) throws Exception
      Specified by:
      handleCommand in class AbstractUntypedPersistentActor
      Throws:
      Exception
    • handleRecover

      protected final void handleRecover(Object message)
      Specified by:
      handleRecover in class AbstractUntypedPersistentActor
    • getConfig

      protected final RemoteOpsProviderConfig getConfig()
    • updateLocalBucket

      protected final void updateLocalBucket(T data)
    • onBucketRemoved

      protected abstract void onBucketRemoved(Address address, Bucket<T> bucket)
      Callback to subclasses invoked when a bucket is removed.
      Parameters:
      address - Remote address
      bucket - Bucket removed
    • onBucketsUpdated

      protected abstract void onBucketsUpdated(Map<Address,Bucket<T>> newBuckets)
      Callback to subclasses invoked when the set of remote buckets is updated.
      Parameters:
      newBuckets - Map of address to new bucket. Never null, but can be empty.
    • isPersisting

      protected boolean isPersisting()