GCounter

Implements a 'Growing Counter' CRDT, also called a 'G-Counter'.

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

A G-Counter is a increment-only counter (inspired by vector clocks) in which only increment and merge are possible. Incrementing the counter adds 1 to the count for the current node. Divergent histories are resolved by taking the maximum count for each node (like a vector clock merge). The value of the counter is the sum of all node counts.

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

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

Type members

Types

Value members

Concrete methods

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

Increment the counter with the delta n specified. The delta must be zero or positive.

Increment the counter with the delta n specified. The delta must be zero or positive.

Source:
GCounter.scala
override def equals(o: Any): Boolean
Definition Classes
Any
Source:
GCounter.scala
def getValue: BigInteger

Java API: Current total value of the counter.

Java API: Current total value of the counter.

Source:
GCounter.scala
override def hashCode: Int
Definition Classes
Any
Source:
GCounter.scala

Increment the counter with the delta n specified. The delta n must be zero or positive.

Increment the counter with the delta n specified. The delta n must be zero or positive.

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

Scala API: Current total value of the counter.

Scala API: Current total value of the counter.

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

Deprecated methods

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

Concrete fields

override val delta: Option[GCounter]