Class Replicator
- All Implemented Interfaces:
Actor,ActorLogging
The Replicator actor takes care of direct replication and gossip based
dissemination of Conflict Free Replicated Data Types (CRDTs) to replicas in the
the cluster.
The data types must be convergent CRDTs and implement ReplicatedData, i.e.
they provide a monotonic merge function and the state changes always converge.
You can use your own custom ReplicatedData or DeltaReplicatedData types,
and several types are provided by this package, such as:
- Counters:
GCounter,PNCounter - Registers:
LWWRegister,Flag - Sets:
GSet,ORSet - Maps:
ORMap,ORMultiMap,LWWMap,PNCounterMap
For good introduction to the CRDT subject watch the Eventually Consistent Data Structures talk by Sean Cribbs and and the talk by Mark Shapiro and read the excellent paper A comprehensive study of Convergent and Commutative Replicated Data Types by Mark Shapiro et. al.
The Replicator actor must be started on each node in the cluster, or group of
nodes tagged with a specific role. It communicates with other Replicator instances
with the same path (without address) that are running on other nodes . For convenience it
can be used with the DistributedData extension but it can also be started as an ordinary
actor using the Replicator.props. If it is started as an ordinary actor it is important
that it is given the same name, started on same path, on all nodes.
Delta State Replicated Data Types are supported. delta-CRDT is a way to reduce the need for sending the full state for updates. For example adding element 'c' and 'd' to set {'a', 'b'} would result in sending the delta {'c', 'd'} and merge that with the state on the receiving side, resulting in set {'a', 'b', 'c', 'd'}.
The protocol for replicating the deltas supports causal consistency if the data type
is marked with RequiresCausalDeliveryOfDeltas. Otherwise it is only eventually
consistent. Without causal consistency it means that if elements 'c' and 'd' are
added in two separate Update operations these deltas may occasionally be propagated
to nodes in different order than the causal order of the updates. For this example it
can result in that set {'a', 'b', 'd'} can be seen before element 'c' is seen. Eventually
it will be {'a', 'b', 'c', 'd'}.
== Update ==
To modify and replicate a ReplicatedData value you send a Replicator.Update message
to the local Replicator.
The current data value for the key of the Update is passed as parameter to the modify
function of the Update. The function is supposed to return the new value of the data, which
will then be replicated according to the given consistency level.
The modify function is called by the Replicator actor and must therefore be a pure
function that only uses the data parameter and stable fields from enclosing scope. It must
for example not access sender() reference of an enclosing actor.
Update is intended to only be sent from an actor running in same local ActorSystem as
the Replicator, because the modify function is typically not serializable.
You supply a write consistency level which has the following meaning:
WriteLocalthe value will immediately only be written to the local replica, and later disseminated with gossipWriteTo(n)the value will immediately be written to at leastnreplicas, including the local replicaWriteMajoritythe value will immediately be written to a majority of replicas, i.e. at leastN/2 + 1replicas, where N is the number of nodes in the cluster (or cluster role group)WriteAllthe value will immediately be written to all nodes in the cluster (or all nodes in the cluster role group)
As reply of the Update a Replicator.UpdateSuccess is sent to the sender of the
Update if the value was successfully replicated according to the supplied consistency
level within the supplied timeout. Otherwise a Replicator.UpdateFailure subclass is
sent back. Note that a Replicator.UpdateTimeout reply does not mean that the update completely failed
or was rolled back. It may still have been replicated to some nodes, and will eventually
be replicated to all nodes with the gossip protocol.
You will always see your own writes. For example if you send two Update messages
changing the value of the same key, the modify function of the second message will
see the change that was performed by the first Update message.
In the Update message you can pass an optional request context, which the Replicator
does not care about, but is included in the reply messages. This is a convenient
way to pass contextual information (e.g. original sender) without having to use ask
or local correlation data structures.
== Get ==
To retrieve the current value of a data you send Replicator.Get message to the
Replicator. You supply a consistency level which has the following meaning:
ReadLocalthe value will only be read from the local replicaReadFrom(n)the value will be read and merged fromnreplicas, including the local replicaReadMajoritythe value will be read and merged from a majority of replicas, i.e. at leastN/2 + 1replicas, where N is the number of nodes in the cluster (or cluster role group)ReadAllthe value will be read and merged from all nodes in the cluster (or all nodes in the cluster role group)
As reply of the Get a Replicator.GetSuccess is sent to the sender of the
Get if the value was successfully retrieved according to the supplied consistency
level within the supplied timeout. Otherwise a Replicator.GetFailure is sent.
If the key does not exist the reply will be Replicator.NotFound.
You will always read your own writes. For example if you send a Update message
followed by a Get of the same key the Get will retrieve the change that was
performed by the preceding Update message. However, the order of the reply messages are
not defined, i.e. in the previous example you may receive the GetSuccess before
the UpdateSuccess.
In the Get message you can pass an optional request context in the same way as for the
Update message, described above. For example the original sender can be passed and replied
to after receiving and transforming GetSuccess.
== Subscribe ==
You may also register interest in change notifications by sending Replicator.Subscribe
message to the Replicator. It will send Replicator.Changed messages to the registered
subscriber when the data for the subscribed key is updated. Subscribers will be notified
periodically with the configured notify-subscribers-interval, and it is also possible to
send an explicit Replicator.FlushChanges message to the Replicator to notify the subscribers
immediately.
The subscriber is automatically removed if the subscriber is terminated. A subscriber can
also be deregistered with the Replicator.Unsubscribe message.
== Delete ==
A data entry can be deleted by sending a Replicator.Delete message to the local
local Replicator. As reply of the Delete a Replicator.DeleteSuccess is sent to
the sender of the Delete if the value was successfully deleted according to the supplied
consistency level within the supplied timeout. Otherwise a Replicator.ReplicationDeleteFailure
is sent. Note that ReplicationDeleteFailure does not mean that the delete completely failed or
was rolled back. It may still have been replicated to some nodes, and may eventually be replicated
to all nodes.
A deleted key cannot be reused again, but it is still recommended to delete unused
data entries because that reduces the replication overhead when new nodes join the cluster.
Subsequent Delete, Update and Get requests will be replied with Replicator.DataDeleted,
Replicator.UpdateDataDeleted and Replicator.GetDataDeleted respectively.
Subscribers will receive Replicator.Deleted.
In the Delete message you can pass an optional request context in the same way as for the
Update message, described above. For example the original sender can be passed and replied
to after receiving and transforming DeleteSuccess.
== CRDT Garbage ==
One thing that can be problematic with CRDTs is that some data types accumulate history (garbage).
For example a GCounter keeps track of one counter per node. If a GCounter has been updated
from one node it will associate the identifier of that node forever. That can become a problem
for long running systems with many cluster nodes being added and removed. To solve this problem
the Replicator performs pruning of data associated with nodes that have been removed from the
cluster. Data types that need pruning have to implement RemovedNodePruning. The pruning consists
of several steps:
- When a node is removed from the cluster it is first important that all updates that were
done by that node are disseminated to all other nodes. The pruning will not start before the
maxPruningDisseminationduration has elapsed. The time measurement is stopped when any replica is unreachable, but it's still recommended to configure this with certain margin. It should be in the magnitude of minutes. - The nodes are ordered by their address and the node ordered first is called leader.
The leader initiates the pruning by adding a
PruningInitializedmarker in the data envelope. This is gossiped to all other nodes and they mark it as seen when they receive it. - When the leader sees that all other nodes have seen the
PruningInitializedmarker the leader performs the pruning and changes the marker toPruningPerformedso that nobody else will redo the pruning. The data envelope with this pruning state is a CRDT itself. The pruning is typically performed by "moving" the part of the data associated with the removed node to the leader node. For example, aGCounteris aMapwith the node as key and the counts done by that node as value. When pruning the value of the removed node is moved to the entry owned by the leader node. SeeRemovedNodePruning.prune(org.apache.pekko.cluster.UniqueAddress, org.apache.pekko.cluster.UniqueAddress). - Thereafter the data is always cleared from parts associated with the removed node so that
it does not come back when merging. See
RemovedNodePruning.pruningCleanup(org.apache.pekko.cluster.UniqueAddress) - After another
maxPruningDisseminationduration after pruning the last entry from the removed node thePruningPerformedmarkers in the data envelope are collapsed into a single tombstone entry, for efficiency. Clients may continue to use old data and therefore all data are always cleared from parts associated with tombstoned nodes.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classReplicator.Changed<A extends ReplicatedData>The data value is retrieved withReplicator.Changed.get(org.apache.pekko.cluster.ddata.Key<T>)using the typed key.static classstatic interfaceReplicator.Command<A extends ReplicatedData>static final classReplicator.DataDeleted<A extends ReplicatedData>static classstatic final classReplicator.Delete<A extends ReplicatedData>Send this message to the localReplicatorto delete a data value for the givenkey.static classstatic final classReplicator.Deleted<A extends ReplicatedData>static classstatic interfaceReplicator.DeleteResponse<A extends ReplicatedData>static final classReplicator.DeleteSuccess<A extends ReplicatedData>static classstatic classNotify subscribers of changes now, otherwise they will be notified periodically with the configurednotify-subscribers-interval.static final classReplicator.Get<A extends ReplicatedData>Send this message to the localReplicatorto retrieve a data value for the givenkey.static classstatic final classReplicator.GetDataDeleted<A extends ReplicatedData>TheReplicator.Getrequest couldn't be performed because the entry has been deleted.static classstatic final classReplicator.GetFailure<A extends ReplicatedData>TheReplicator.Getrequest could not be fulfill according to the givenconsistency levelandtimeout.static classstatic classINTERNAL APIstatic classstatic classGet current number of replicas, including the local replica.static classReplicator.GetResponse<A extends ReplicatedData>static final classReplicator.GetSuccess<A extends ReplicatedData>Reply fromGet.static classstatic classINTERNAL APIstatic final classReplicator.ModifyFailure<A extends ReplicatedData>If themodifyfunction of theReplicator.Updatethrows an exception the reply message will be thisModifyFailuremessage.static classstatic final classReplicator.NotFound<A extends ReplicatedData>static classstatic final classstatic classstatic interfacestatic final classstatic classstatic classstatic final classstatic classstatic final classReadMajoritybut with the given number ofadditionalnodes added to the majority count.static classstatic final classCurrent number of replicas.static classstatic final classstatic classstatic interfaceMarker trait for remote messages serialized bypekko.cluster.ddata.protobuf.ReplicatorMessageSerializer.static final classReplicator.StoreFailure<A extends ReplicatedData>The local store or direct replication of theReplicator.Updatecould not be fulfill according to the givenconsistency leveldue to durable store errors.static classstatic final classReplicator.Subscribe<A extends ReplicatedData>Register a subscriber that will be notified with aReplicator.Changedmessage when the value of the givenkeyis changed.static classstatic interfaceReplicator.SubscribeResponse<A extends ReplicatedData>static final classReplicator.Unsubscribe<A extends ReplicatedData>Unregister a subscriber.static classstatic final classReplicator.Update<A extends ReplicatedData>static classstatic final classReplicator.UpdateDataDeleted<A extends ReplicatedData>TheReplicator.Updatecouldn't be performed because the entry has been deleted.static classstatic classReplicator.UpdateFailure<A extends ReplicatedData>static classReplicator.UpdateResponse<A extends ReplicatedData>static final classReplicator.UpdateSuccess<A extends ReplicatedData>static classstatic final classReplicator.UpdateTimeout<A extends ReplicatedData>The direct replication of theReplicator.Updatecould not be fulfill according to the givenconsistency levelandtimeout.static classstatic final classstatic classstatic interfacestatic classstatic final classstatic classstatic final classWriteMajoritybut with the given number ofadditionalnodes added to the majority count.static classstatic final classstatic classNested classes/interfaces inherited from interface org.apache.pekko.actor.Actor
Actor.emptyBehavior$, Actor.ignoringBehavior$ -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongvoidallReachableClockTime_$eq(long x$1) protected voidaroundReceive(scala.PartialFunction<Object, scala.runtime.BoxedUnit> rcv, Object msg) INTERNAL API.scala.collection.immutable.Set<String>changed()voidchanged_$eq(scala.collection.immutable.Set<String> x$1) cluster()voidcontext()Scala API: Stores the context for this actor, including self, and sender.scala.collection.immutable.Map<String,scala.Tuple2<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope, ByteString>> voiddataEntries_$eq(scala.collection.immutable.Map<String, scala.Tuple2<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope, ByteString>> x$1) static intvoidscala.Option<Cancellable>scala.Tuple2<ByteString,Object> digest(org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope envelope) scala.collection.immutable.Set<String>durable()scala.collection.immutable.Set<String>scala.collection.immutable.SortedSet<UniqueAddress>voidexitingNodes_$eq(scala.collection.immutable.SortedSet<UniqueAddress> x$1) static Replicator.FlushChanges$Java API: TheFlushChangesinstancebooleanvoidfullStateGossipEnabled_$eq(boolean x$1) scala.Option<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope>longgetDeltaSeqNr(String key, UniqueAddress fromNode) static Replicator.GetReplicaCount$Java API: TheGetReplicaCountinstancevoidgossipTo(UniqueAddress address) booleanbooleanhasSubscriber(ActorRef subscriber) voidbooleanbooleanisLeader()booleanisLocalGet(Replicator.ReadConsistency readConsistency) booleanbooleanisLocalUpdate(Replicator.WriteConsistency writeConsistency) booleanisNodeRemoved(UniqueAddress node, scala.collection.Iterable<String> keys) scala.collection.immutable.SortedSet<UniqueAddress>voidjoiningNodes_$eq(scala.collection.immutable.SortedSet<UniqueAddress> x$1) scala.collection.immutable.TreeSet<Member>leader()voidleader_$eq(scala.collection.immutable.TreeSet<Member> x$1) scala.PartialFunction<Object,scala.runtime.BoxedUnit> load()booleanlongscala.collection.immutable.SortedSet<Member>voidmembersByAge_$eq(scala.collection.immutable.SortedSet<Member> x$1) scala.collection.immutable.SortedSet<UniqueAddress>nodes()voidnodes_$eq(scala.collection.immutable.SortedSet<UniqueAddress> x$1) scala.PartialFunction<Object,scala.runtime.BoxedUnit> protected voidScala API: Stores the context for this actor, including self, and sender.protected final voidThe 'self' field holds the ActorRef for this actor.voidvoidpostStop()User overridable callback.voidpreStart()User overridable callback.longvoidpreviousClockTime_$eq(long x$1) static Propsprops(ReplicatorSettings settings) Factory method for thepekko.actor.Propsof theReplicatoractor.scala.Option<Cancellable>static Replicator.ReadLocal$Java API: TheReadLocalinstancescala.PartialFunction<Object,scala.runtime.BoxedUnit> receive()Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.voidvoidreceiveDelete(Key<ReplicatedData> key, Replicator.WriteConsistency consistency, scala.Option<Object> req) voidreceiveDeltaPropagation(UniqueAddress fromNode, boolean reply, scala.collection.immutable.Map<String, org.apache.pekko.cluster.ddata.Replicator.Internal.Delta> deltas) voidvoidvoidreceiveGet(Key<ReplicatedData> key, Replicator.ReadConsistency consistency, scala.Option<Object> req) voidvoidvoidreceiveGossip(scala.collection.immutable.Map<String, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope> updatedData, boolean sendBack, scala.Option<Object> fromSystemUid) voidvoidvoidvoidvoidvoidvoidvoidvoidreceiveRead(String key) voidreceiveReadRepair(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope writeEnvelope) voidvoidreceiveStatus(scala.collection.immutable.Map<String, ByteString> otherDigests, int chunk, int totChunks, scala.Option<Object> fromSystemUid) voidreceiveSubscribe(Key<ReplicatedData> key, ActorRef subscriber) voidvoidvoidreceiveUnsubscribe(Key<ReplicatedData> key, ActorRef subscriber) <A extends ReplicatedData>
voidreceiveUpdate(Key<ReplicatedData> key, scala.Function1<scala.Option<A>, A> modify, Replicator.WriteConsistency writeConsistency, scala.Option<Object> req) voidreceiveWrite(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope envelope) scala.collection.immutable.Map<UniqueAddress,Object> voidremovedNodes_$eq(scala.collection.immutable.Map<UniqueAddress, Object> x$1) replica(UniqueAddress node) replyTo()voidreplyTo_$eq(ActorRef x$1) scala.Option<UniqueAddress>selectRandomNode(scala.collection.immutable.IndexedSeq<UniqueAddress> addresses) final ActorRefself()The 'self' field holds the ActorRef for this actor.scala.Some<Object>org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelopelongvoidstatusCount_$eq(long x$1) intvoidstatusTotChunks_$eq(int x$1) scala.collection.immutable.Map<String,Key<ReplicatedData>> voidsubscriptionKeys_$eq(scala.collection.immutable.Map<String, Key<ReplicatedData>> x$1) User overridable definition the strategy to use for supervising child actors.scala.collection.immutable.Set<UniqueAddress>voidunreachable_$eq(scala.collection.immutable.Set<UniqueAddress> x$1) scala.collection.immutable.SortedSet<UniqueAddress>voidweaklyUpNodes_$eq(scala.collection.immutable.SortedSet<UniqueAddress> x$1) scala.Option<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope>voidwriteAndStore(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope writeEnvelope, boolean reply) static Replicator.WriteLocal$Java API: TheWriteLocalinstanceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.actor.Actor
aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, postRestart, preRestart, sender, unhandledMethods inherited from interface org.apache.pekko.actor.ActorLogging
_log_$eq, log
-
Constructor Details
-
Replicator
-
-
Method Details
-
props
Factory method for thepekko.actor.Propsof theReplicatoractor. -
DefaultMajorityMinCap
public static int DefaultMajorityMinCap() -
readLocal
Java API: TheReadLocalinstance -
writeLocal
Java API: TheWriteLocalinstance -
getReplicaCount
Java API: TheGetReplicaCountinstance -
flushChanges
Java API: TheFlushChangesinstance -
context
Description copied from interface:ActorScala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
pekko.actor.ActorContextis the Scala API.getContextreturns apekko.actor.AbstractActor.ActorContext, which is the Java API of the actor context. -
self
Description copied from interface:ActorThe 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
-
org$apache$pekko$actor$Actor$_setter_$context_$eq
Description copied from interface:ActorScala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such asforward.WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!
pekko.actor.ActorContextis the Scala API.getContextreturns apekko.actor.AbstractActor.ActorContext, which is the Java API of the actor context.- Specified by:
org$apache$pekko$actor$Actor$_setter_$context_$eqin interfaceActor
-
org$apache$pekko$actor$Actor$_setter_$self_$eq
Description copied from interface:ActorThe 'self' field holds the ActorRef for this actor. Can be used to send messages to itself:self ! message
- Specified by:
org$apache$pekko$actor$Actor$_setter_$self_$eqin interfaceActor
-
cluster
-
selfAddress
-
selfUniqueAddress
-
selfFromSystemUid
-
gossipTask
-
notifyTask
-
pruningTask
-
clockTask
-
serializer
-
maxPruningDisseminationNanos
public long maxPruningDisseminationNanos() -
hasDurableKeys
public boolean hasDurableKeys() -
durable
-
durableWildcards
-
durableStore
-
deltaPropagationSelector
-
deltaPropagationTask
-
nodes
-
nodes_$eq
-
membersByAge
-
membersByAge_$eq
-
weaklyUpNodes
-
weaklyUpNodes_$eq
-
joiningNodes
-
joiningNodes_$eq
-
exitingNodes
-
exitingNodes_$eq
-
removedNodes
-
removedNodes_$eq
-
leader
-
leader_$eq
-
isLeader
public boolean isLeader() -
previousClockTime
public long previousClockTime() -
previousClockTime_$eq
public void previousClockTime_$eq(long x$1) -
allReachableClockTime
public long allReachableClockTime() -
allReachableClockTime_$eq
public void allReachableClockTime_$eq(long x$1) -
unreachable
-
unreachable_$eq
-
dataEntries
public scala.collection.immutable.Map<String,scala.Tuple2<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope, dataEntries()ByteString>> -
dataEntries_$eq
public void dataEntries_$eq(scala.collection.immutable.Map<String, scala.Tuple2<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope, ByteString>> x$1) -
changed
-
changed_$eq
-
statusCount
public long statusCount() -
statusCount_$eq
public void statusCount_$eq(long x$1) -
statusTotChunks
public int statusTotChunks() -
statusTotChunks_$eq
public void statusTotChunks_$eq(int x$1) -
fullStateGossipEnabled
public boolean fullStateGossipEnabled() -
fullStateGossipEnabled_$eq
public void fullStateGossipEnabled_$eq(boolean x$1) -
subscribers
-
newSubscribers
-
subscriptionKeys
-
subscriptionKeys_$eq
-
replyTo
-
replyTo_$eq
-
aroundReceive
Description copied from interface:ActorINTERNAL API.Can be overridden to intercept calls to this actor's current behavior.
- Specified by:
aroundReceivein interfaceActor- Parameters:
rcv- current behavior.msg- current message.
-
preStart
public void preStart()Description copied from interface:ActorUser overridable callback. Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation. -
postStop
public void postStop()Description copied from interface:ActorUser overridable callback. Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation. -
matchingRole
-
supervisorStrategy
Description copied from interface:ActorUser overridable definition the strategy to use for supervising child actors.- Specified by:
supervisorStrategyin interfaceActor
-
receive
Description copied from interface:ActorScala API: This defines the initial actor behavior, it must return a partial function with the actor logic. -
load
-
normalReceive
-
receiveGet
public void receiveGet(Key<ReplicatedData> key, Replicator.ReadConsistency consistency, scala.Option<Object> req) -
isLocalGet
-
receiveRead
-
isLocalSender
public boolean isLocalSender() -
receiveUpdate
public <A extends ReplicatedData> void receiveUpdate(Key<ReplicatedData> key, scala.Function1<scala.Option<A>, A> modify, Replicator.WriteConsistency writeConsistency, scala.Option<Object> req) -
isDurable
-
isLocalUpdate
-
receiveWrite
public void receiveWrite(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope envelope) -
writeAndStore
public void writeAndStore(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope writeEnvelope, boolean reply) -
write
public scala.Option<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope> write(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope writeEnvelope) -
receiveReadRepair
public void receiveReadRepair(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope writeEnvelope) -
receiveGetKeyIds
public void receiveGetKeyIds() -
receiveDelete
public void receiveDelete(Key<ReplicatedData> key, Replicator.WriteConsistency consistency, scala.Option<Object> req) -
setData
public org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope setData(String key, org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope envelope) -
getDigest
-
digest
public scala.Tuple2<ByteString,Object> digest(org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope envelope) - Returns:
- SHA-1 digest of the serialized data, and the size of the serialized data
-
getData
public scala.Option<org.apache.pekko.cluster.ddata.Replicator.Internal.DataEnvelope> getData(String key) -
getDeltaSeqNr
-
isNodeRemoved
-
receiveFlushChanges
public void receiveFlushChanges() -
receiveDeltaPropagationTick
public void receiveDeltaPropagationTick() -
receiveDeltaPropagation
public void receiveDeltaPropagation(UniqueAddress fromNode, boolean reply, scala.collection.immutable.Map<String, org.apache.pekko.cluster.ddata.Replicator.Internal.Delta> deltas) -
receiveGossipTick
public void receiveGossipTick() -
gossipTo
-
selectRandomNode
public scala.Option<UniqueAddress> selectRandomNode(scala.collection.immutable.IndexedSeq<UniqueAddress> addresses) -
replica
-
receiveStatus
public void receiveStatus(scala.collection.immutable.Map<String, ByteString> otherDigests, int chunk, int totChunks, scala.Option<Object> fromSystemUid) -
receiveGossip
-
receiveSubscribe
-
receiveUnsubscribe
-
hasSubscriber
-
receiveTerminated
-
receiveMemberJoining
-
receiveMemberWeaklyUp
-
receiveMemberUp
-
receiveMemberExiting
-
receiveMemberRemoved
-
receiveOtherMemberEvent
-
receiveUnreachable
-
receiveReachable
-
receiveClockTick
public void receiveClockTick() -
receiveRemovedNodePruningTick
public void receiveRemovedNodePruningTick() -
collectRemovedNodes
public void collectRemovedNodes() -
initRemovedNodePruning
public void initRemovedNodePruning() -
performRemovedNodePruning
public void performRemovedNodePruning() -
deleteObsoletePruningPerformed
public void deleteObsoletePruningPerformed() -
receiveGetReplicaCount
public void receiveGetReplicaCount()
-