Package io.debezium.crdt
Class StateBasedPNDeltaCounter
java.lang.Object
io.debezium.crdt.StateBasedPNCounter
io.debezium.crdt.StateBasedPNDeltaCounter
- All Implemented Interfaces:
Count,DeltaCount,DeltaCounter,GCount,GCounter,PNCount,PNCounter
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedStateBasedPNDeltaCounter(long totalAdds, long totalRemoves, long recentAdds, long recentRemoves) -
Method Summary
Modifier and TypeMethodDescriptionDecrement the counter and get the result.longDecrement the counter and get the result.longDecrement the counter and get the result.longIncrement the counter and get the result.Get the changes in the current value during the last interval.Get the value of this count prior to thechanges.booleanDetermine if there are any changes in this count.Increment the counter and get the result.longIncrement the counter and get the result.Merge the supplied counter into this counter.voidreset()Start a new interval and reset theDeltaCount.getChanges()to initial values.toString()Methods inherited from class io.debezium.crdt.StateBasedPNCounter
get, getDecrement, getIncrementMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.debezium.crdt.GCount
getIncrementMethods inherited from interface io.debezium.crdt.PNCount
get, getDecrement
-
Field Details
-
delta
-
-
Constructor Details
-
StateBasedPNDeltaCounter
protected StateBasedPNDeltaCounter() -
StateBasedPNDeltaCounter
protected StateBasedPNDeltaCounter(long totalAdds, long totalRemoves, long recentAdds, long recentRemoves)
-
-
Method Details
-
increment
Description copied from interface:PNCounterIncrement the counter and get the result.- Specified by:
incrementin interfaceDeltaCounter- Specified by:
incrementin interfaceGCounter- Specified by:
incrementin interfacePNCounter- Overrides:
incrementin classStateBasedPNCounter- Returns:
- this instance so methods can be chained together; never null
-
decrement
Description copied from interface:PNCounterDecrement the counter and get the result.- Specified by:
decrementin interfaceDeltaCounter- Specified by:
decrementin interfacePNCounter- Overrides:
decrementin classStateBasedPNCounter- Returns:
- this instance so methods can be chained together; never null
-
incrementAndGet
public long incrementAndGet()Description copied from interface:GCounterIncrement the counter and get the result.- Specified by:
incrementAndGetin interfaceGCounter- Overrides:
incrementAndGetin classStateBasedPNCounter- Returns:
- the current result after incrementing
-
decrementAndGet
public long decrementAndGet()Description copied from interface:PNCounterDecrement the counter and get the result.- Specified by:
decrementAndGetin interfacePNCounter- Overrides:
decrementAndGetin classStateBasedPNCounter- Returns:
- the current result after decrementing
-
getAndIncrement
public long getAndIncrement()Description copied from interface:GCounterIncrement the counter and get the result.- Specified by:
getAndIncrementin interfaceGCounter- Overrides:
getAndIncrementin classStateBasedPNCounter- Returns:
- the current result before incrementing
-
getAndDecrement
public long getAndDecrement()Description copied from interface:PNCounterDecrement the counter and get the result.- Specified by:
getAndDecrementin interfacePNCounter- Overrides:
getAndDecrementin classStateBasedPNCounter- Returns:
- the current result before decrementing
-
getChanges
Description copied from interface:DeltaCountGet the changes in the current value during the last interval.- Specified by:
getChangesin interfaceDeltaCount- Returns:
- the changes in the value during the last interval; never null
-
hasChanges
public boolean hasChanges()Description copied from interface:DeltaCountDetermine if there are any changes in this count.- Specified by:
hasChangesin interfaceDeltaCount- Returns:
trueif there are non-zerochanges, orfalseotherwise
-
getPriorCount
Description copied from interface:DeltaCountGet the value of this count prior to thechanges.- Specified by:
getPriorCountin interfaceDeltaCount- Returns:
- the prior count; never null
-
reset
public void reset()Description copied from interface:DeltaCounterStart a new interval and reset theDeltaCount.getChanges()to initial values.- Specified by:
resetin interfaceDeltaCounter
-
merge
Description copied from interface:PNCounterMerge the supplied counter into this counter.- Specified by:
mergein interfaceDeltaCounter- Specified by:
mergein interfaceGCounter- Specified by:
mergein interfacePNCounter- Overrides:
mergein classStateBasedPNCounter- Parameters:
other- the other counter to merge into this one; may be null- Returns:
- this counter so that methods can be chained
-
toString
- Overrides:
toStringin classStateBasedPNCounter
-