Package akka.cluster.ddata
Class PNCounterMap<A>
- java.lang.Object
- 
- akka.cluster.ddata.PNCounterMap<A>
 
- 
- All Implemented Interfaces:
- DeltaReplicatedData,- RemovedNodePruning,- ReplicatedData,- ReplicatedDataSerialization,- java.io.Serializable
 
 public final class PNCounterMap<A> extends java.lang.Object implements DeltaReplicatedData, ReplicatedDataSerialization, RemovedNodePruning Map of named counters. SpecializedORMapwithPNCountervalues.This class is immutable, i.e. "modifying" methods return a new instance. - See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPNCounterMap.PNCounterMapTag$INTERNAL API
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A> PNCounterMap<A>apply()booleancontains(A key)static <A> PNCounterMap<A>create()Java APIPNCounterMap<A>decrement(SelfUniqueAddress node, A key, long delta)Decrement the counter with the delta specified.PNCounterMap<A>decrementBy(A key, long delta, SelfUniqueAddress node)Decrement the counter with the delta specified.longdecrementBy$default$2()scala.Option<ORMap.DeltaOp>delta()The accumulated delta of mutator operations since previousDeltaReplicatedData.resetDelta().static <A> PNCounterMap<A>empty()scala.collection.immutable.Map<A,scala.math.BigInt>entries()Scala APIbooleanequals(java.lang.Object o)scala.Option<scala.math.BigInt>get(A key)Scala API: The count for a keyjava.util.Map<A,java.math.BigInteger>getEntries()Java APIjava.math.BigIntegergetValue(A key)Java API: The count for a key, ornullif it doesn't existinthashCode()PNCounterMap<A>increment(SelfUniqueAddress node, A key, long delta)Increment the counter with the delta specified.PNCounterMap<A>increment(A key, long delta, Cluster node)Increment the counter with the delta specified.longincrement$default$2()PNCounterMap<A>incrementBy(A key, long delta, SelfUniqueAddress node)Increment the counter with the delta specified.booleanisEmpty()PNCounterMap<A>merge(PNCounterMap<A> that)PNCounterMap<A>mergeDelta(ORMap.DeltaOp 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.PNCounterMap<A>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.PNCounterMap<A>pruningCleanup(UniqueAddress removedNode)Remove data entries from a node that has been removed from the cluster and already been pruned.PNCounterMap<A>remove(A key, SelfUniqueAddress node)Removes an entry from the map.PNCounterMap<A>resetDelta()Reset collection of deltas from mutator operations.intsize()java.lang.StringtoString()static <A> scala.Option<scala.collection.immutable.Map<A,scala.math.BigInt>>unapply(PNCounterMap<A> m)Extract theentries().- 
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.ReplicatedDatamerge
 
- 
 
- 
- 
- 
Method Detail- 
emptypublic static <A> PNCounterMap<A> empty() 
 - 
applypublic static <A> PNCounterMap<A> apply() 
 - 
createpublic static <A> PNCounterMap<A> create() Java API
 - 
unapplypublic static <A> scala.Option<scala.collection.immutable.Map<A,scala.math.BigInt>> unapply(PNCounterMap<A> m) Extract theentries().
 - 
entriespublic scala.collection.immutable.Map<A,scala.math.BigInt> entries() Scala API
 - 
getEntriespublic java.util.Map<A,java.math.BigInteger> getEntries() Java API
 - 
getpublic scala.Option<scala.math.BigInt> get(A key) Scala API: The count for a key
 - 
getValuepublic java.math.BigInteger getValue(A key) Java API: The count for a key, ornullif it doesn't exist
 - 
containspublic boolean contains(A key) 
 - 
isEmptypublic boolean isEmpty() 
 - 
sizepublic int size() 
 - 
incrementBypublic PNCounterMap<A> incrementBy(A key, long delta, SelfUniqueAddress node) Increment the counter with the delta specified. If the delta is negative then it will decrement instead of increment.
 - 
incrementpublic PNCounterMap<A> increment(A key, long delta, Cluster node) Increment the counter with the delta specified. If the delta is negative then it will decrement instead of increment.
 - 
incrementpublic PNCounterMap<A> increment(SelfUniqueAddress node, A key, long delta) Increment the counter with the delta specified. If the delta is negative then it will decrement instead of increment.
 - 
increment$default$2public long increment$default$2() 
 - 
decrementBypublic PNCounterMap<A> decrementBy(A key, long delta, SelfUniqueAddress node) Decrement the counter with the delta specified. If the delta is negative then it will increment instead of decrement. TODO add implicit after deprecated is EOL.
 - 
decrementpublic PNCounterMap<A> decrement(SelfUniqueAddress node, A key, long delta) Decrement the counter with the delta specified. If the delta is negative then it will increment instead of decrement. TODO add implicit after deprecated is EOL.
 - 
decrementBy$default$2public long decrementBy$default$2() 
 - 
removepublic PNCounterMap<A> remove(A key, SelfUniqueAddress node) Removes an entry from the map. Note that if there is a conflicting update on another node the entry will not be removed after merge.
 - 
mergepublic PNCounterMap<A> merge(PNCounterMap<A> that) 
 - 
resetDeltapublic PNCounterMap<A> 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
 
 - 
deltapublic scala.Option<ORMap.DeltaOp> 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
 
 - 
mergeDeltapublic PNCounterMap<A> mergeDelta(ORMap.DeltaOp thatDelta) 
 - 
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 PNCounterMap<A> 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 PNCounterMap<A> 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
 
 
- 
 
-