Package io.debezium.crdt
Interface DeltaCounter
- All Known Implementing Classes:
StateBasedPNDeltaCounter
A simple counter that maintains a single changing value by separately tracking the positive and negative changes, and by
tracking recent
changes
in this value since last reset
. It is
inspired by the conflict-free replicated data type (CRDT) P-N Counter. The semantics ensure the value converges toward the
global number of increments minus the number of decrements. The global total can be calculated by merging
all the replicated instances, without regard to order of merging.-
Method Summary
Modifier and TypeMethodDescriptionDecrement the counter and get the result.Increment the counter and get the result.Merge the supplied counter into this counter.void
reset()
Start a new interval and reset theDeltaCount.getChanges()
to initial values.Methods inherited from interface io.debezium.crdt.DeltaCount
getChanges, getPriorCount, hasChanges
Methods inherited from interface io.debezium.crdt.GCount
getIncrement
Methods inherited from interface io.debezium.crdt.GCounter
getAndIncrement, incrementAndGet
Methods inherited from interface io.debezium.crdt.PNCount
get, getDecrement
Methods inherited from interface io.debezium.crdt.PNCounter
decrementAndGet, getAndDecrement
-
Method Details
-
increment
DeltaCounter increment()Increment the counter and get the result. -
decrement
DeltaCounter decrement()Decrement the counter and get the result. -
merge
Merge the supplied counter into this counter. -
reset
void reset()Start a new interval and reset theDeltaCount.getChanges()
to initial values.
-