Interface CheckpointProgress
-
- All Known Implementing Classes:
CheckpointProgressImpl
public interface CheckpointProgressRepresents information of a progress of a current checkpoint and allows to obtain future to wait for a particular checkpoint state.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearCounters()Clear cp progress counters.intcurrentCheckpointPagesCount()voidcurrentCheckpointPagesCount(int num)Sets current checkpoint pages num to store.AtomicIntegerevictedPagesCounter()voidfail(Throwable error)Mark this checkpoint execution as failed.GridFutureAdapterfutureFor(CheckpointState state)PartitionDestroyQueuegetDestroyQueue()voidinitCounters(int pagesSize)Initialize all counters before checkpoint.booleaninProgress()voidonStateChanged(CheckpointState state, Runnable clo)Invokes a callback closure then a checkpoint reaches specific state.@Nullable Stringreason()AtomicIntegersyncedPagesCounter()voidtransitTo(@NotNull CheckpointState newState)Changing checkpoint state if order of state is correct.voidupdateEvictedPages(int delta)Update evicted pages in checkpoint;voidupdateSyncedPages(int delta)Update synced pages in checkpoint;voidupdateWrittenPages(int delta)Update written pages in checkpoint;AtomicIntegerwrittenPagesCounter()
-
-
-
Method Detail
-
reason
@Nullable @Nullable String reason()
- Returns:
- Description of the reason of the current checkpoint.
-
inProgress
boolean inProgress()
- Returns:
trueif the current checkpoint is inCheckpointStatewhich shows that checkpoint has already started but not finished yet.
-
futureFor
GridFutureAdapter futureFor(CheckpointState state)
- Returns:
- The future which can be used for detection when current checkpoint reaches the specific state.
-
fail
void fail(Throwable error)
Mark this checkpoint execution as failed.- Parameters:
error- Causal error of fail.
-
transitTo
void transitTo(@NotNull @NotNull CheckpointState newState)Changing checkpoint state if order of state is correct.- Parameters:
newState- New checkpoint state.
-
getDestroyQueue
PartitionDestroyQueue getDestroyQueue()
- Returns:
- PartitionDestroyQueue.
-
writtenPagesCounter
AtomicInteger writtenPagesCounter()
- Returns:
- Counter for written checkpoint pages. Not
nullonly if checkpoint is running.
-
syncedPagesCounter
AtomicInteger syncedPagesCounter()
- Returns:
- Counter for fsynced checkpoint pages. Not
nullonly if checkpoint is running.
-
evictedPagesCounter
AtomicInteger evictedPagesCounter()
- Returns:
- Counter for evicted pages during current checkpoint. Not
nullonly if checkpoint is running.
-
currentCheckpointPagesCount
int currentCheckpointPagesCount()
- Returns:
- Number of pages in current checkpoint. If checkpoint is not running, returns 0.
-
currentCheckpointPagesCount
void currentCheckpointPagesCount(int num)
Sets current checkpoint pages num to store.- Parameters:
num- Pages to store.
-
initCounters
void initCounters(int pagesSize)
Initialize all counters before checkpoint.
-
updateSyncedPages
void updateSyncedPages(int delta)
Update synced pages in checkpoint;- Parameters:
delta- Pages num to update.
-
updateWrittenPages
void updateWrittenPages(int delta)
Update written pages in checkpoint;- Parameters:
delta- Pages num to update.
-
updateEvictedPages
void updateEvictedPages(int delta)
Update evicted pages in checkpoint;- Parameters:
delta- Pages num to update.
-
clearCounters
void clearCounters()
Clear cp progress counters.
-
onStateChanged
void onStateChanged(CheckpointState state, Runnable clo)
Invokes a callback closure then a checkpoint reaches specific state. The closure will not be called if an error has happened while transitting to the state.- Parameters:
state- State.clo- Closure to call.
-
-