Package io.debezium.crdt
Interface DeltaCounter
-
- All Known Implementing Classes:
StateBasedPNDeltaCounter
@NotThreadSafe public interface DeltaCounter extends PNCounter, DeltaCount
A simple counter that maintains a single changing value by separately tracking the positive and negative changes, and by tracking recentchanges
in this value since lastreset
. 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 bymerging
all the replicated instances, without regard to order of merging.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DeltaCounter
decrement()
Decrement the counter and get the result.DeltaCounter
increment()
Increment the counter and get the result.DeltaCounter
merge(Count other)
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 Detail
-
increment
DeltaCounter increment()
Increment the counter and get the result.
-
decrement
DeltaCounter decrement()
Decrement the counter and get the result.
-
merge
DeltaCounter merge(Count other)
Merge the supplied counter into this counter.
-
reset
void reset()
Start a new interval and reset theDeltaCount.getChanges()
to initial values.
-
-