Interface PartitionUpdateCounter
-
- All Superinterfaces:
Iterable<long[]>
- All Known Implementing Classes:
PartitionUpdateCounterDebugWrapper,PartitionUpdateCounterErrorWrapper,PartitionUpdateCounterTrackingImpl,PartitionUpdateCounterVolatileImpl
public interface PartitionUpdateCounter extends Iterable<long[]>
Partition update counter maintains three entities for tracking partition update state.- Low water mark (LWM) or update counter - lowest applied sequential update number.
- High water mark (HWM) or reservation counter - highest seen but unapplied yet update number.
- Out-of-order applied updates in range between LWM and HWM
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ObjectcomparableState()CacheGroupContextcontext()PartitionUpdateCountercopy()booleanempty()GridLongListfinalizeUpdateCounters()Flushes pending update counters closing all possible gaps.longget()Get LWM.@org.jetbrains.annotations.Nullable byte[]getBytes()longhighestAppliedCounter()Returns highest applied update counter.voidinit(long initUpdCntr, @org.jetbrains.annotations.Nullable byte[] cntrUpdData)Restores update counter state.longinitial()Deprecated.TODO LWM should be used as initial counter https://ggsystems.atlassian.net/browse/GG-17396Iterator<long[]>iterator()longnext()Increment LWM by 1.longnext(long delta)Increment LWM by delta.longreserve(long delta)Increment HWM by delta.longreserved()Returns HWM.voidreset()Reset counter internal state to zero.voidresetInitialCounter()Reset the initial counter value to zero.booleansequential()voidupdate(long val)Sets update counter to absolute value.booleanupdate(long start, long delta)Applies counter update out of range.voidupdateInitial(long start, long delta)Deprecated.TODO https://ggsystems.atlassian.net/browse/GG-17396-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
init
void init(long initUpdCntr, @Nullable @org.jetbrains.annotations.Nullable byte[] cntrUpdData)Restores update counter state.- Parameters:
initUpdCntr- LWM.cntrUpdData- Counter updates raw data.
-
initial
long initial()
Deprecated.TODO LWM should be used as initial counter https://ggsystems.atlassian.net/browse/GG-17396
-
get
long get()
Get LWM.- Returns:
- Current LWM.
-
next
long next()
Increment LWM by 1.- Returns:
- New LWM.
-
next
long next(long delta)
Increment LWM by delta.- Parameters:
delta- Delta.- Returns:
- New LWM.
-
reserve
long reserve(long delta)
Increment HWM by delta.- Parameters:
delta- Delta.- Returns:
- New HWM.
-
reserved
long reserved()
Returns HWM.- Returns:
- Current HWM.
-
highestAppliedCounter
long highestAppliedCounter()
Returns highest applied update counter.- Returns:
- Highest applied counter.
-
update
void update(long val) throws IgniteCheckedExceptionSets update counter to absolute value. All missed updates will be discarded.- Parameters:
val- Absolute value.- Throws:
IgniteCheckedException- if counter cannot be set to passed value due to incompatibility with current state.
-
update
boolean update(long start, long delta)Applies counter update out of range. Update ranges must not intersect.- Parameters:
start- Start (<= lwm).delta- Delta.- Returns:
Trueif update was actually applied.
-
reset
void reset()
Reset counter internal state to zero.
-
resetInitialCounter
void resetInitialCounter()
Reset the initial counter value to zero.
-
updateInitial
void updateInitial(long start, long delta)Deprecated.TODO https://ggsystems.atlassian.net/browse/GG-17396- Parameters:
start- Counter.delta- Delta.
-
finalizeUpdateCounters
GridLongList finalizeUpdateCounters()
Flushes pending update counters closing all possible gaps.- Returns:
- Even-length array of pairs [start, end] for each gap.
-
getBytes
@Nullable @org.jetbrains.annotations.Nullable byte[] getBytes()
-
sequential
boolean sequential()
- Returns:
Trueif counter has no missed updates.
-
empty
boolean empty()
- Returns:
Trueif counter has not seen any update.
-
iterator
Iterator<long[]> iterator()
-
context
CacheGroupContext context()
- Returns:
- Cache group context.
-
copy
PartitionUpdateCounter copy()
- Returns:
- A deep copy of current instance.
-
comparableState
Object comparableState()
- Returns:
- Comparable counter state.
-
-