Class DistributedData
- All Implemented Interfaces:
Extension
Replicator. Configuration settings are defined in the
pekko.cluster.ddata section, see reference.conf.
This is using the same underlying Replicator instance as
pekko.cluster.ddata.DistributedData and that means that typed
and classic actors can share the same data.
This class is not intended for user extension other than for test purposes (e.g. stub implementation). More methods may be added in the future and that may break such implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final Tapply(ActorSystem<?> system) static DistributedDatacreateExtension(ActorSystem<?> system) static final booleanstatic DistributedDataget(ActorSystem<?> system) static final inthashCode()static ExtensionId<T>id()abstract ActorRef<Replicator.Command>ActorRefof theReplicator.abstract SelfUniqueAddressstatic <A,B extends ReplicatedData>
Behavior<A>withReplicatorMessageAdapter(Function<ReplicatorMessageAdapter<A, B>, Behavior<A>> factory) When interacting with theDistributedData.replicatorfrom an actor theReplicatorMessageAdapterprovides convenient methods that adapts the response messages to the requesting actor's message protocol.
-
Constructor Details
-
DistributedData
public DistributedData()
-
-
Method Details
-
get
-
createExtension
-
withReplicatorMessageAdapter
public static <A,B extends ReplicatedData> Behavior<A> withReplicatorMessageAdapter(Function<ReplicatorMessageAdapter<A, B>, Behavior<A>> factory) When interacting with theDistributedData.replicatorfrom an actor theReplicatorMessageAdapterprovides convenient methods that adapts the response messages to the requesting actor's message protocol.One
ReplicatorMessageAdapterinstance can be used for a givenReplicatedDatatype, e.g. anOrSet. Interaction with severalpekko.cluster.ddata.Keys can be used via the same adapter but they must all be of the sameReplicatedDatatype. For interaction with several differentReplicatedDatatypes, e.g. anOrSetand aGCounter, an adapter can be created for each type.*Warning*: A
ReplicatorMessageAdapterinstance is not thread-safe and must only be used from a single actor It must not be accessed from threads other than the ordinary actor message processing thread, such asCompletionStagecallbacks. It must not be shared between several actor instances.- Parameters:
factory- Factory of theBehaviorfor the actor that is using theReplicatorMessageAdapter
-
apply
-
hashCode
public static final int hashCode() -
equals
-
id
-
replicator
ActorRefof theReplicator.- See Also:
-
DistributedData.withReplicatorMessageAdapter
-
selfUniqueAddress
-