Package io.debezium.crdt
Class StateBasedPNCounter
java.lang.Object
io.debezium.crdt.StateBasedPNCounter
- Direct Known Subclasses:
StateBasedPNDeltaCounter
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDecrement the counter and get the result.long
Decrement the counter and get the result.long
get()
Get the current value.long
Decrement the counter and get the result.long
Increment the counter and get the result.long
Get the amount that the value decremented.long
Get the amount that the value incremented.Increment the counter and get the result.long
Increment the counter and get the result.Merge the supplied counter into this counter.toString()
-
Field Details
-
adds
private long adds -
removes
private long removes
-
-
Constructor Details
-
StateBasedPNCounter
protected StateBasedPNCounter() -
StateBasedPNCounter
protected StateBasedPNCounter(long adds, long removes)
-
-
Method Details
-
increment
Description copied from interface:PNCounter
Increment the counter and get the result. -
decrement
Description copied from interface:PNCounter
Decrement the counter and get the result. -
incrementAndGet
public long incrementAndGet()Description copied from interface:GCounter
Increment the counter and get the result.- Specified by:
incrementAndGet
in interfaceGCounter
- Returns:
- the current result after incrementing
-
decrementAndGet
public long decrementAndGet()Description copied from interface:PNCounter
Decrement the counter and get the result.- Specified by:
decrementAndGet
in interfacePNCounter
- Returns:
- the current result after decrementing
-
getAndIncrement
public long getAndIncrement()Description copied from interface:GCounter
Increment the counter and get the result.- Specified by:
getAndIncrement
in interfaceGCounter
- Returns:
- the current result before incrementing
-
getAndDecrement
public long getAndDecrement()Description copied from interface:PNCounter
Decrement the counter and get the result.- Specified by:
getAndDecrement
in interfacePNCounter
- Returns:
- the current result before decrementing
-
get
public long get()Description copied from interface:PNCount
Get the current value. -
getIncrement
public long getIncrement()Description copied from interface:GCount
Get the amount that the value incremented.- Specified by:
getIncrement
in interfaceGCount
- Returns:
- the incremented value
-
getDecrement
public long getDecrement()Description copied from interface:PNCount
Get the amount that the value decremented. Thevalue
is thetotal increments
minus thetotal decrements
- Specified by:
getDecrement
in interfacePNCount
- Returns:
- the decremented value
-
merge
Description copied from interface:PNCounter
Merge the supplied counter into this counter. -
toString
-