Package org.apache.pekko.cluster.ddata
Class GCounter
java.lang.Object
org.apache.pekko.cluster.ddata.GCounter
- All Implemented Interfaces:
Serializable,DeltaReplicatedData,FastMerge,RemovedNodePruning,ReplicatedData,ReplicatedDataSerialization,ReplicatedDelta
public final class GCounter
extends Object
implements DeltaReplicatedData, ReplicatedDelta, ReplicatedDataSerialization, RemovedNodePruning, FastMerge
- See Also:
-
Method Summary
Modifier and TypeMethodDescription$colon$plus(long n, SelfUniqueAddress node) Increment the counter with the deltanspecified.static GCounterapply()static GCountercreate()Java APIscala.Option<GCounter>delta()The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta().static GCounterempty()booleangetValue()Java API: Current total value of the counter.inthashCode()increment(SelfUniqueAddress node, long n) Increment the counter with the deltanspecified.mergeDelta(GCounter thatDelta) scala.collection.immutable.Set<UniqueAddress>The nodes that have changed the state for this data and would need pruning when such node is no longer part of the cluster.booleanneedPruningFrom(UniqueAddress removedNode) Does it have any state changes from a specific node, which has been removed from the cluster.prune(UniqueAddress removedNode, UniqueAddress collapseInto) When theremovednode has been removed from the cluster the state changes from that node will be pruned by collapsing the data entries to another node.pruningCleanup(UniqueAddress removedNode) Remove data entries from a node that has been removed from the cluster and already been pruned.Reset collection of deltas from mutator operations.toString()static scala.Option<scala.math.BigInt>Extract thevalue().scala.math.BigIntvalue()Scala API: Current total value of the counter.zero()The empty full state.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.pekko.cluster.ddata.DeltaReplicatedData
mergeDeltaMethods inherited from interface org.apache.pekko.cluster.ddata.FastMerge
ancestor_$eq, assignAncestor, clearAncestor, isAncestorOfMethods inherited from interface org.apache.pekko.cluster.ddata.ReplicatedData
merge
-
Method Details
-
empty
-
apply
-
create
Java API -
unapply
Extract thevalue(). -
delta
Description copied from interface:DeltaReplicatedDataThe 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 theDeltaReplicatedData.delta()accessor. Themodifyfunction shall still return the full state in the same way asReplicatedDatawithout support for deltas.- Specified by:
deltain interfaceDeltaReplicatedData
-
value
public scala.math.BigInt value()Scala API: Current total value of the counter. -
getValue
Java API: Current total value of the counter. -
$colon$plus
Increment the counter with the deltanspecified. The delta must be zero or positive. -
increment
Increment the counter with the deltanspecified. The deltanmust be zero or positive. -
merge
-
mergeDelta
-
zero
Description copied from interface:ReplicatedDeltaThe empty full state. This is used when a delta is received and no existing full state exists on the receiving side. Then the delta is merged into thezeroto create the initial full state.- Specified by:
zeroin interfaceReplicatedDelta
-
resetDelta
Description copied from interface:DeltaReplicatedDataReset collection of deltas from mutator operations. When theReplicatorinvokes themodifyfunction of theUpdatemessage the delta is always "reset" and when 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 theDeltaReplicatedData.delta()accessor. When theReplicatorhas grabbed thedeltait will invoke this method to get a clean data instance without the delta.- Specified by:
resetDeltain interfaceDeltaReplicatedData
-
modifiedByNodes
Description copied from interface:RemovedNodePruningThe nodes that have changed the state for this data and would need pruning when such node is no longer part of the cluster.- Specified by:
modifiedByNodesin interfaceRemovedNodePruning
-
needPruningFrom
Description copied from interface:RemovedNodePruningDoes it have any state changes from a specific node, which has been removed from the cluster.- Specified by:
needPruningFromin interfaceRemovedNodePruning
-
prune
Description copied from interface:RemovedNodePruningWhen theremovednode has been removed from the cluster the state changes from that node will be pruned by collapsing the data entries to another node.- Specified by:
prunein interfaceRemovedNodePruning
-
pruningCleanup
Description copied from interface:RemovedNodePruningRemove data entries from a node that has been removed from the cluster and already been pruned.- Specified by:
pruningCleanupin interfaceRemovedNodePruning
-
toString
-
equals
-
hashCode
public int hashCode()
-