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
Type members
Value members
Concrete methods
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
Java API: Current total value of the counter.
Java API: Current total value of the counter.
- 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
Scala API: Current total value of the counter.
Scala API: Current total value of the counter.
- Source:
- GCounter.scala
Deprecated methods
- Deprecated
[Since version 2.5.20]
- Source:
- GCounter.scala
- Deprecated
[Since version 2.5.20]
- Source:
- GCounter.scala