public final class PNCounterMap extends java.lang.Object implements ReplicatedData, ReplicatedDataSerialization, RemovedNodePruning
ORMap
with PNCounter
values.
This class is immutable, i.e. "modifying" methods return a new instance.
Constructor and Description |
---|
PNCounterMap(ORMap<PNCounter> underlying) |
Modifier and Type | Method and Description |
---|---|
static PNCounterMap |
apply() |
boolean |
contains(java.lang.String key) |
static PNCounterMap |
create()
Java API
|
PNCounterMap |
decrement(Cluster node,
java.lang.String key,
long delta)
Decrement the counter with the delta specified.
|
PNCounterMap |
decrement(java.lang.String key,
long delta,
Cluster node)
Decrement the counter with the delta specified.
|
PNCounterMap |
decrement(UniqueAddress node,
java.lang.String key,
long delta)
INTERNAL API
|
static PNCounterMap |
empty() |
scala.collection.immutable.Map<java.lang.String,scala.math.BigInt> |
entries()
Scala API
|
boolean |
equals(java.lang.Object o) |
scala.Option<scala.math.BigInt> |
get(java.lang.String key)
Scala API: The count for a key
|
java.util.Map<java.lang.String,java.math.BigInteger> |
getEntries()
Java API
|
java.math.BigInteger |
getValue(java.lang.String key)
Java API: The count for a key, or
null if it doesn't exist |
int |
hashCode() |
PNCounterMap |
increment(Cluster node,
java.lang.String key,
long delta)
Increment the counter with the delta specified.
|
PNCounterMap |
increment(java.lang.String key,
long delta,
Cluster node)
Increment the counter with the delta specified.
|
PNCounterMap |
increment(UniqueAddress node,
java.lang.String key,
long delta)
INTERNAL API
|
boolean |
isEmpty() |
PNCounterMap |
merge(PNCounterMap that) |
boolean |
needPruningFrom(UniqueAddress removedNode)
Does it have any state changes from a specific node,
which has been removed from the cluster.
|
PNCounterMap |
prune(UniqueAddress removedNode,
UniqueAddress collapseInto)
When the
removed node has been removed from the cluster the state
changes from that node will be pruned by collapsing the data entries
to another node. |
PNCounterMap |
pruningCleanup(UniqueAddress removedNode)
Remove data entries from a node that has been removed from the cluster
and already been pruned.
|
PNCounterMap |
remove(Cluster node,
java.lang.String key)
Removes an entry from the map.
|
PNCounterMap |
remove(UniqueAddress node,
java.lang.String key)
INTERNAL API
|
int |
size() |
java.lang.String |
toString() |
static scala.Option<scala.collection.immutable.Map<java.lang.String,scala.math.BigInt>> |
unapply(PNCounterMap m)
Extract the
entries() . |
ORMap<PNCounter> |
underlying() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
merge
public static PNCounterMap empty()
public static PNCounterMap apply()
public static PNCounterMap create()
public static scala.Option<scala.collection.immutable.Map<java.lang.String,scala.math.BigInt>> unapply(PNCounterMap m)
entries()
.m
- (undocumented)public scala.collection.immutable.Map<java.lang.String,scala.math.BigInt> entries()
public java.util.Map<java.lang.String,java.math.BigInteger> getEntries()
public scala.Option<scala.math.BigInt> get(java.lang.String key)
key
- (undocumented)public java.math.BigInteger getValue(java.lang.String key)
null
if it doesn't existkey
- (undocumented)public boolean contains(java.lang.String key)
public boolean isEmpty()
public int size()
public PNCounterMap increment(java.lang.String key, long delta, Cluster node)
key
- (undocumented)delta
- (undocumented)node
- (undocumented)public PNCounterMap increment(Cluster node, java.lang.String key, long delta)
node
- (undocumented)key
- (undocumented)delta
- (undocumented)public PNCounterMap increment(UniqueAddress node, java.lang.String key, long delta)
node
- (undocumented)key
- (undocumented)delta
- (undocumented)public PNCounterMap decrement(java.lang.String key, long delta, Cluster node)
key
- (undocumented)delta
- (undocumented)node
- (undocumented)public PNCounterMap decrement(Cluster node, java.lang.String key, long delta)
node
- (undocumented)key
- (undocumented)delta
- (undocumented)public PNCounterMap decrement(UniqueAddress node, java.lang.String key, long delta)
node
- (undocumented)key
- (undocumented)delta
- (undocumented)public PNCounterMap remove(Cluster node, java.lang.String key)
node
- (undocumented)key
- (undocumented)public PNCounterMap remove(UniqueAddress node, java.lang.String key)
node
- (undocumented)key
- (undocumented)public PNCounterMap merge(PNCounterMap that)
public boolean needPruningFrom(UniqueAddress removedNode)
RemovedNodePruning
needPruningFrom
in interface RemovedNodePruning
removedNode
- (undocumented)public PNCounterMap prune(UniqueAddress removedNode, UniqueAddress collapseInto)
RemovedNodePruning
removed
node has been removed from the cluster the state
changes from that node will be pruned by collapsing the data entries
to another node.prune
in interface RemovedNodePruning
removedNode
- (undocumented)collapseInto
- (undocumented)public PNCounterMap pruningCleanup(UniqueAddress removedNode)
RemovedNodePruning
pruningCleanup
in interface RemovedNodePruning
removedNode
- (undocumented)public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object