Class CheckpointWorkflow
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointWorkflow
-
public class CheckpointWorkflow extends Object
This class responsibility is to complementCheckpointerclass with side logic of checkpointing like checkpoint listeners notifications, WAL records management and checkpoint markers management. It allowsCheckpointerclass is to focus on its main responsibility: synchronizing memory with disk. Additional actions needed during checkpoint are implemented in this class. Two main blocks of logic this class is responsible for:markCheckpointBegin(long, org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgressImpl, org.apache.ignite.internal.processors.cache.persistence.pagemem.CheckpointMetricsTracker, org.apache.ignite.internal.util.worker.WorkProgressDispatcher)- Initialization of next checkpoint. It collects all required info
If also provides checkpointer with information aboutmarkCheckpointEnd(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint)- Finalization of last checkpoint.dataRegionswhere to collect dirty pages andcacheGroupsContextsneeded to perform checkpoint operation.
-
-
Field Summary
Fields Modifier and Type Field Description static intDFLT_CHECKPOINT_PARALLEL_SORT_THRESHOLD
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCheckpointListener(CheckpointListener lsnr, DataRegion dataRegion)Adding the listener which will be called only when given data region will be checkpointed.voidfinalizeCheckpointOnRecovery(long cpTs, UUID cpId, WALPointer walPtr, StripedExecutor exec, CheckpointPagesWriterFactory checkpointPagesWriterFactory)This method makes sense if node was stopped during the checkpoint(Start marker was written to disk while end marker are not).List<CheckpointListener>getRelevantCheckpointListeners(Collection<DataRegion> checkpointedRegions)org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointmarkCheckpointBegin(long cpTs, CheckpointProgressImpl curr, CheckpointMetricsTracker tracker, WorkProgressDispatcher workProgressDispatcher)First stage of checkpoint which collects demanded information(dirty pages mostly).voidmarkCheckpointEnd(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp)Do some actions on checkpoint finish(After all pages were written to disk).voidmemoryRecoveryRecordPtr(WALPointer memoryRecoveryRecordPtr)voidremoveCheckpointListener(CheckpointListener lsnr)voidstart()Prepare all structure to further work.voidstop()Stop any activity.
-
-
-
Method Detail
-
markCheckpointBegin
public org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint markCheckpointBegin(long cpTs, CheckpointProgressImpl curr, CheckpointMetricsTracker tracker, WorkProgressDispatcher workProgressDispatcher) throws IgniteCheckedExceptionFirst stage of checkpoint which collects demanded information(dirty pages mostly).- Parameters:
cpTs- Checkpoint start timestamp.curr- Current checkpoint event info.tracker- Checkpoint metrics tracker.workProgressDispatcher- Work progress dispatcher.- Returns:
- Checkpoint collected info.
- Throws:
IgniteCheckedException- if fail.
-
markCheckpointEnd
public void markCheckpointEnd(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp) throws IgniteCheckedExceptionDo some actions on checkpoint finish(After all pages were written to disk).- Parameters:
chp- Checkpoint snapshot.- Throws:
IgniteCheckedException
-
getRelevantCheckpointListeners
public List<CheckpointListener> getRelevantCheckpointListeners(Collection<DataRegion> checkpointedRegions)
- Parameters:
checkpointedRegions- Regions which will be checkpointed.- Returns:
- Checkpoint listeners which should be handled.
-
finalizeCheckpointOnRecovery
public void finalizeCheckpointOnRecovery(long cpTs, UUID cpId, WALPointer walPtr, StripedExecutor exec, CheckpointPagesWriterFactory checkpointPagesWriterFactory) throws IgniteCheckedExceptionThis method makes sense if node was stopped during the checkpoint(Start marker was written to disk while end marker are not). It is able to write all pages to disk and create end marker.- Throws:
IgniteCheckedException- If failed.
-
memoryRecoveryRecordPtr
public void memoryRecoveryRecordPtr(WALPointer memoryRecoveryRecordPtr)
- Parameters:
memoryRecoveryRecordPtr- Memory recovery record pointer.
-
addCheckpointListener
public void addCheckpointListener(CheckpointListener lsnr, DataRegion dataRegion)
Adding the listener which will be called only when given data region will be checkpointed.- Parameters:
lsnr- Listener.dataRegion- Data region for which listener is corresponded to.
-
removeCheckpointListener
public void removeCheckpointListener(CheckpointListener lsnr)
- Parameters:
lsnr- Listener.
-
stop
public void stop()
Stop any activity.
-
start
public void start()
Prepare all structure to further work. This object should be fully ready to work after call of this method.
-
-