Package io.debezium.crdt
Class StateBasedPNCounter
java.lang.Object
io.debezium.crdt.StateBasedPNCounter
- Direct Known Subclasses:
StateBasedPNDeltaCounter
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecrement the counter and get the result.longDecrement the counter and get the result.longget()Get the current value.longDecrement the counter and get the result.longIncrement the counter and get the result.longGet the amount that the value decremented.longGet the amount that the value incremented.Increment the counter and get the result.longIncrement 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:PNCounterIncrement the counter and get the result. -
decrement
Description copied from interface:PNCounterDecrement the counter and get the result. -
incrementAndGet
public long incrementAndGet()Description copied from interface:GCounterIncrement the counter and get the result.- Specified by:
incrementAndGetin interfaceGCounter- 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- 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- 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- Returns:
- the current result before decrementing
-
get
public long get()Description copied from interface:PNCountGet the current value. -
getIncrement
public long getIncrement()Description copied from interface:GCountGet the amount that the value incremented.- Specified by:
getIncrementin interfaceGCount- Returns:
- the incremented value
-
getDecrement
public long getDecrement()Description copied from interface:PNCountGet the amount that the value decremented. Thevalueis thetotal incrementsminus thetotal decrements- Specified by:
getDecrementin interfacePNCount- Returns:
- the decremented value
-
merge
Description copied from interface:PNCounterMerge the supplied counter into this counter. -
toString
-