Package io.debezium.crdt
Interface GCounter
-
- All Known Subinterfaces:
DeltaCounter
,PNCounter
- All Known Implementing Classes:
StateBasedGCounter
,StateBasedPNCounter
,StateBasedPNDeltaCounter
@NotThreadSafe public interface GCounter extends GCount
A simple grow-only counter that maintains a single changing value by tracking the positive changes to the value. It is inspired by the conflict-free replicated data type (CRDT) G Counter.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getAndIncrement()
Increment the counter and get the result.GCounter
increment()
Increment the counter and get the result.long
incrementAndGet()
Increment the counter and get the result.GCounter
merge(Count other)
Merge the supplied counter into this counter.-
Methods inherited from interface io.debezium.crdt.GCount
getIncrement
-
-
-
-
Method Detail
-
increment
GCounter increment()
Increment the counter and get the result.- Returns:
- this instance so methods can be chained together; never null
-
incrementAndGet
long incrementAndGet()
Increment the counter and get the result.- Returns:
- the current result after incrementing
-
getAndIncrement
long getAndIncrement()
Increment the counter and get the result.- Returns:
- the current result before incrementing
-
-