Class CheckpointProgressImpl
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgressImpl
-
- All Implemented Interfaces:
CheckpointProgress
public class CheckpointProgressImpl extends Object implements CheckpointProgress
Data class representing the state of running/scheduled checkpoint.
-
-
Method Summary
All Methods Instance Methods Concrete 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()booleangreaterOrEqualTo(CheckpointState expectedState)voidinitCounters(int pagesSize)Initialize all counters before checkpoint.booleaninProgress()longnextCpNanos()voidnextCpNanos(long nextCpNanos)voidonStateChanged(CheckpointState state, Runnable clo)Invokes a callback closure then a checkpoint reaches specific state.Stringreason()voidreason(String reason)AtomicIntegersyncedPagesCounter()voidtransitTo(@NotNull CheckpointState newState)Changing checkpoint state if order of state is correct.voidupdateEvictedPages(int delta)Update evicted pages in checkpoint;voidupdateSyncedPages(int deltha)Update synced pages in checkpoint;voidupdateWrittenPages(int deltha)Update written pages in checkpoint;AtomicIntegerwrittenPagesCounter()
-
-
-
Method Detail
-
inProgress
public boolean inProgress()
- Specified by:
inProgressin interfaceCheckpointProgress- Returns:
trueIf checkpoint already started but have not finished yet.
-
greaterOrEqualTo
public boolean greaterOrEqualTo(CheckpointState expectedState)
- Parameters:
expectedState- Expected state.- Returns:
trueif current state equal to given state.
-
futureFor
public GridFutureAdapter futureFor(CheckpointState state)
- Specified by:
futureForin interfaceCheckpointProgress- Parameters:
state- State for which future should be returned.- Returns:
- Existed or new future which corresponds to the given state.
-
fail
public void fail(Throwable error)
Mark this checkpoint execution as failed.- Specified by:
failin interfaceCheckpointProgress- Parameters:
error- Causal error of fail.
-
transitTo
public void transitTo(@NotNull @NotNull CheckpointState newState)Changing checkpoint state if order of state is correct.- Specified by:
transitToin interfaceCheckpointProgress- Parameters:
newState- New checkpoint state.
-
getDestroyQueue
public PartitionDestroyQueue getDestroyQueue()
- Specified by:
getDestroyQueuein interfaceCheckpointProgress- Returns:
- Destroy queue.
-
nextCpNanos
public long nextCpNanos()
- Returns:
- Scheduled time of checkpoint.
-
nextCpNanos
public void nextCpNanos(long nextCpNanos)
- Parameters:
nextCpNanos- New scheduled time of checkpoint.
-
reason
public String reason()
- Specified by:
reasonin interfaceCheckpointProgress- Returns:
- Description of the reason of the current checkpoint.
-
reason
public void reason(String reason)
- Parameters:
reason- New wakeup reason.
-
writtenPagesCounter
public AtomicInteger writtenPagesCounter()
- Specified by:
writtenPagesCounterin interfaceCheckpointProgress- Returns:
- Counter for written checkpoint pages. Not
nullonly if checkpoint is running.
-
updateWrittenPages
public void updateWrittenPages(int deltha)
Update written pages in checkpoint;- Specified by:
updateWrittenPagesin interfaceCheckpointProgress- Parameters:
deltha- Pages num to update.
-
syncedPagesCounter
public AtomicInteger syncedPagesCounter()
- Specified by:
syncedPagesCounterin interfaceCheckpointProgress- Returns:
- Counter for fsynced checkpoint pages. Not
nullonly if checkpoint is running.
-
updateSyncedPages
public void updateSyncedPages(int deltha)
Update synced pages in checkpoint;- Specified by:
updateSyncedPagesin interfaceCheckpointProgress- Parameters:
deltha- Pages num to update.
-
evictedPagesCounter
public AtomicInteger evictedPagesCounter()
- Specified by:
evictedPagesCounterin interfaceCheckpointProgress- Returns:
- Counter for evicted pages during current checkpoint. Not
nullonly if checkpoint is running.
-
updateEvictedPages
public void updateEvictedPages(int delta)
Update evicted pages in checkpoint;- Specified by:
updateEvictedPagesin interfaceCheckpointProgress- Parameters:
delta- Pages num to update.
-
currentCheckpointPagesCount
public int currentCheckpointPagesCount()
- Specified by:
currentCheckpointPagesCountin interfaceCheckpointProgress- Returns:
- Number of pages in current checkpoint. If checkpoint is not running, returns 0.
-
currentCheckpointPagesCount
public void currentCheckpointPagesCount(int num)
Sets current checkpoint pages num to store.- Specified by:
currentCheckpointPagesCountin interfaceCheckpointProgress- Parameters:
num- Pages to store.
-
initCounters
public void initCounters(int pagesSize)
Initialize all counters before checkpoint.- Specified by:
initCountersin interfaceCheckpointProgress
-
clearCounters
public void clearCounters()
Clear cp progress counters.- Specified by:
clearCountersin interfaceCheckpointProgress
-
onStateChanged
public 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.- Specified by:
onStateChangedin interfaceCheckpointProgress- Parameters:
state- State.clo- Closure to call.
-
-