Package org.apache.pekko.cluster.ddata
Class AbstractDeltaReplicatedData<A extends AbstractDeltaReplicatedData<A,B>,B extends ReplicatedDelta>
java.lang.Object
org.apache.pekko.cluster.ddata.AbstractReplicatedData<A>
org.apache.pekko.cluster.ddata.AbstractDeltaReplicatedData<A,B>
- All Implemented Interfaces:
DeltaReplicatedData,ReplicatedData
public abstract class AbstractDeltaReplicatedData<A extends AbstractDeltaReplicatedData<A,B>,B extends ReplicatedDelta>
extends AbstractReplicatedData<A>
implements DeltaReplicatedData
Java API: Interface for implementing a
DeltaReplicatedData in Java.
The type parameter A is a self-recursive type to be defined by the
concrete implementation.
E.g. class TwoPhaseSet extends AbstractDeltaReplicatedData<TwoPhaseSet, TwoPhaseSet>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal scala.Option<ReplicatedDelta>delta()Delegates todeltaData(), which must be implemented by subclass.The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta().final ReplicatedDatamergeDelta(ReplicatedDelta that) Delegates tomergeDeltaData(B), which must be implemented by subclass.abstract AmergeDeltaData(B that) When delta is merged into the full state this method is used.Methods inherited from class org.apache.pekko.cluster.ddata.AbstractReplicatedData
merge, mergeDataMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.cluster.ddata.DeltaReplicatedData
mergeDelta, resetDeltaMethods inherited from interface org.apache.pekko.cluster.ddata.ReplicatedData
merge
-
Constructor Details
-
AbstractDeltaReplicatedData
public AbstractDeltaReplicatedData()
-
-
Method Details
-
delta
Delegates todeltaData(), which must be implemented by subclass.- Specified by:
deltain interfaceDeltaReplicatedData
-
deltaData
The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta(). When theReplicatorinvokes themodifyfunction of theUpdatemessage and the user code is invoking one or more mutator operations the data is collecting the delta of the operations and makes it available for theReplicatorwith thedeltaData()accessor. Themodifyfunction shall still return the full state in the same way asReplicatedDatawithout support for deltas. -
mergeDelta
Delegates tomergeDeltaData(B), which must be implemented by subclass. -
mergeDeltaData
When delta is merged into the full state this method is used. When the typeDof the delta is of the same type as the full stateTthis method can be implemented by delegating tomergeData.
-