PNCounter

Implements a 'Increment/Decrement Counter' CRDT, also called a 'PN-Counter'.

It is described in the paper A comprehensive study of Convergent and Commutative Replicated Data Types.

PN-Counters allow the counter to be incremented by tracking the increments (P) separate from the decrements (N). Both P and N are represented as two internal GCounters. Merge is handled by merging the internal P and N counters. The value of the counter is the value of the P counter minus the value of the N counter.

This class is immutable, i.e. "modifying" methods return a new instance.

Companion:
object
Source:
PNCounter.scala
trait Serializable
class Object
trait Matchable
class Any

Type members

Types

Value members

Concrete methods

def :+(n: Long)(implicit node: SelfUniqueAddress): PNCounter

Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Source:
PNCounter.scala
def :+(n: BigInt)(implicit node: SelfUniqueAddress): PNCounter

Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Source:
PNCounter.scala
def decrement(n: Long)(implicit node: SelfUniqueAddress): PNCounter

Decrement the counter with the delta n specified. If the delta is negative then it will increment instead of decrement.

Decrement the counter with the delta n specified. If the delta is negative then it will increment instead of decrement.

Source:
PNCounter.scala
def decrement(n: BigInt)(implicit node: SelfUniqueAddress): PNCounter

Decrement the counter with the delta n specified. If the delta is negative then it will increment instead of decrement.

Decrement the counter with the delta n specified. If the delta is negative then it will increment instead of decrement.

Source:
PNCounter.scala

Decrement the counter with the delta n specified. If the delta n is negative then it will increment instead of decrement.

Decrement the counter with the delta n specified. If the delta n is negative then it will increment instead of decrement.

Source:
PNCounter.scala

Scala API: Decrement the counter with the delta n specified. If the delta n is negative then it will increment instead of decrement.

Scala API: Decrement the counter with the delta n specified. If the delta n is negative then it will increment instead of decrement.

Source:
PNCounter.scala
def decrement(node: SelfUniqueAddress, n: BigInteger): PNCounter

Java API: Decrement the counter with the delta n specified. If the delta n is negative then it will increment instead of decrement.

Java API: Decrement the counter with the delta n specified. If the delta n is negative then it will increment instead of decrement.

Source:
PNCounter.scala
override def delta: Option[PNCounter]
Definition Classes
Source:
PNCounter.scala
override def equals(o: Any): Boolean
Definition Classes
Any
Source:
PNCounter.scala
def getValue: BigInteger

Java API: Current total value of the counter.

Java API: Current total value of the counter.

Source:
PNCounter.scala
override def hashCode: Int
Definition Classes
Any
Source:
PNCounter.scala
def increment(n: Long)(implicit node: SelfUniqueAddress): PNCounter

Scala API: Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Scala API: Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Source:
PNCounter.scala
def increment(n: BigInt)(implicit node: SelfUniqueAddress): PNCounter

Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Source:
PNCounter.scala
def increment(node: SelfUniqueAddress, n: BigInteger): PNCounter

Java API: Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Java API: Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Source:
PNCounter.scala

Java API: Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Java API: Increment the counter with the delta n specified. If the delta is negative then it will decrement instead of increment.

Source:
PNCounter.scala
override def merge(that: PNCounter): PNCounter
Definition Classes
Source:
PNCounter.scala
override def mergeDelta(thatDelta: PNCounter): PNCounter
Definition Classes
Source:
PNCounter.scala
override def needPruningFrom(removedNode: UniqueAddress): Boolean
Definition Classes
Source:
PNCounter.scala
override def prune(removedNode: UniqueAddress, collapseInto: UniqueAddress): PNCounter
Definition Classes
Source:
PNCounter.scala
override def pruningCleanup(removedNode: UniqueAddress): PNCounter
Definition Classes
Source:
PNCounter.scala
override def resetDelta: PNCounter
Definition Classes
Source:
PNCounter.scala
override def toString: String
Definition Classes
Any
Source:
PNCounter.scala

Scala API: Current total value of the counter.

Scala API: Current total value of the counter.

Source:
PNCounter.scala
override def zero: PNCounter
Definition Classes
Source:
PNCounter.scala

Deprecated methods

@deprecated("Use `:+` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def +(n: Long)(implicit node: Cluster): PNCounter
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `:+` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def +(n: BigInt)(implicit node: Cluster): PNCounter
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `decrement` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def -(n: Long)(implicit node: Cluster): PNCounter
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `decrement` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def -(n: BigInt)(implicit node: Cluster): PNCounter
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `decrement` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `decrement` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@/ @deprecated("Use `decrement` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def decrement(node: Cluster, n: BigInteger): PNCounter
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `increment` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `increment` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala
@deprecated("Use `increment` that takes a `SelfUniqueAddress` parameter instead.", since = "2.5.20")
def increment(node: Cluster, n: BigInteger): PNCounter
Deprecated
[Since version 2.5.20]
Source:
PNCounter.scala