Package akka.cluster.ddata
Class GCounter
- java.lang.Object
- 
- akka.cluster.ddata.GCounter
 
- 
- All Implemented Interfaces:
- DeltaReplicatedData,- FastMerge,- RemovedNodePruning,- ReplicatedData,- ReplicatedDataSerialization,- ReplicatedDelta,- java.io.Serializable
 
 public final class GCounter extends java.lang.Object implements DeltaReplicatedData, ReplicatedDelta, ReplicatedDataSerialization, RemovedNodePruning, FastMerge - See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GCounter$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()booleanequals(java.lang.Object o)java.math.BigIntegergetValue()Java API: Current total value of the counter.inthashCode()GCounterincrement(SelfUniqueAddress node, long n)Increment the counter with the deltanspecified.GCountermerge(GCounter that)GCountermergeDelta(GCounter thatDelta)scala.collection.immutable.Set<UniqueAddress>modifiedByNodes()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.GCounterprune(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.GCounterpruningCleanup(UniqueAddress removedNode)Remove data entries from a node that has been removed from the cluster and already been pruned.GCounterresetDelta()Reset collection of deltas from mutator operations.java.lang.StringtoString()static scala.Option<scala.math.BigInt>unapply(GCounter c)Extract thevalue().scala.math.BigIntvalue()Scala API: Current total value of the counter.GCounterzero()The empty full state.- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface akka.cluster.ddata.DeltaReplicatedDatamergeDelta
 - 
Methods inherited from interface akka.cluster.ddata.FastMergeancestor_$eq, assignAncestor, clearAncestor, isAncestorOf
 - 
Methods inherited from interface akka.cluster.ddata.ReplicatedDatamerge
 
- 
 
- 
- 
- 
Method Detail- 
emptypublic static GCounter empty() 
 - 
applypublic static GCounter apply() 
 - 
createpublic static GCounter create() Java API
 - 
deltapublic scala.Option<GCounter> 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 interface- DeltaReplicatedData
 
 - 
valuepublic scala.math.BigInt value() Scala API: Current total value of the counter.
 - 
getValuepublic java.math.BigInteger getValue() Java API: Current total value of the counter.
 - 
$colon$pluspublic GCounter $colon$plus(long n, SelfUniqueAddress node) Increment the counter with the deltanspecified. The delta must be zero or positive.
 - 
incrementpublic GCounter increment(SelfUniqueAddress node, long n) Increment the counter with the deltanspecified. The deltanmust be zero or positive.
 - 
zeropublic GCounter 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 interface- ReplicatedDelta
 
 - 
resetDeltapublic GCounter 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 interface- DeltaReplicatedData
 
 - 
modifiedByNodespublic scala.collection.immutable.Set<UniqueAddress> 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 interface- RemovedNodePruning
 
 - 
needPruningFrompublic boolean needPruningFrom(UniqueAddress removedNode) Description copied from interface:RemovedNodePruningDoes it have any state changes from a specific node, which has been removed from the cluster.- Specified by:
- needPruningFromin interface- RemovedNodePruning
 
 - 
prunepublic GCounter prune(UniqueAddress removedNode, UniqueAddress collapseInto) 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 interface- RemovedNodePruning
 
 - 
pruningCleanuppublic GCounter pruningCleanup(UniqueAddress removedNode) Description copied from interface:RemovedNodePruningRemove data entries from a node that has been removed from the cluster and already been pruned.- Specified by:
- pruningCleanupin interface- RemovedNodePruning
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-