public class CheckpointManager extends Object
() will be consistently saved to disk.
Configuration of this checkpoint allows the following:
Collecting all pages from configured dataRegions which was marked as dirty under ().
Marking the start of checkpoint in WAL and on disk.
Notifying the subscribers of different checkpoint states through CheckpointListener.
Synchronizing collected pages with disk using FilePageStoreManager.
Restoring memory in consistent state if the node failed in the middle of checkpoint.
| Constructor and Description |
|---|
CheckpointManager(Function<Class<?>,IgniteLogger> logger,
String igniteInstanceName,
String checkpointThreadName,
IgniteWriteAheadLogManager wal,
WorkersRegistry workersRegistry,
DataStorageConfiguration persistenceCfg,
FilePageStoreManager pageStoreManager,
IgniteThrowableBiPredicate<Long,Integer> checkpointInapplicableChecker,
Supplier<Collection<DataRegion>> dataRegions,
Supplier<Collection<CacheGroupContext>> cacheGroupContexts,
IgniteThrowableFunction<Integer,PageMemoryEx> pageMemoryGroupResolver,
PageMemoryImpl.ThrottlingPolicy throttlingPolicy,
IgniteCacheSnapshotManager snapshotMgr,
DataStorageMetricsImpl persStoreMetrics,
LongJVMPauseDetector longJvmPauseDetector,
FailureProcessor failureProcessor,
GridCacheProcessor cacheProcessor,
Supplier<Integer> cpFreqDeviation) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCheckpointListener(CheckpointListener lsnr,
DataRegion dataRegion) |
boolean |
cancelOrWaitPartitionDestroy(int grpId,
int partId) |
File |
checkpointDirectory() |
CheckpointHistory |
checkpointHistory() |
CheckpointTimeoutLock |
checkpointTimeoutLock() |
void |
cleanupCheckpointDirectory()
Clean checkpoint directory
CheckpointMarkersStorage.cpDir. |
void |
cleanupTempCheckpointDirectory()
Cleanup checkpoint directory from all temporary files.
|
IgniteInternalFuture<Void> |
enableCheckpoints(boolean enable)
For test use only.
|
void |
finalizeCheckpointOnRecovery(long ts,
UUID id,
WALPointer ptr,
StripedExecutor exec) |
<R> CheckpointProgress |
forceCheckpoint(String reason,
IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
Start the new checkpoint immediately.
|
Checkpointer |
getCheckpointer()
Current checkpointer implementation.
|
void |
init()
Initialize the checkpoint and prepare it to work.
|
void |
initializeStorage()
Initialize checkpoint storage.
|
void |
memoryRecoveryRecordPtr(WALPointer memoryRecoveryRecordPtr) |
CheckpointStatus |
readCheckpointStatus() |
void |
removeCheckpointListener(CheckpointListener lsnr) |
void |
removeCheckpointsUntil(@Nullable WALPointer highBound)
Wal truncate callback.
|
void |
schedulePartitionDestroy(@Nullable CacheGroupContext context,
int groupId,
int partId) |
void |
start()
Checkpoint starts to do their work after this method.
|
void |
stop(boolean cancel) |
void |
threadBuf(ThreadLocal<ByteBuffer> threadBuf)
Replace thread local with buffers.
|
void |
unblockCheckpointLock()
Checkpoint lock blocks when stop method is called.
|
public CheckpointManager(Function<Class<?>,IgniteLogger> logger, String igniteInstanceName, String checkpointThreadName, IgniteWriteAheadLogManager wal, WorkersRegistry workersRegistry, DataStorageConfiguration persistenceCfg, FilePageStoreManager pageStoreManager, IgniteThrowableBiPredicate<Long,Integer> checkpointInapplicableChecker, Supplier<Collection<DataRegion>> dataRegions, Supplier<Collection<CacheGroupContext>> cacheGroupContexts, IgniteThrowableFunction<Integer,PageMemoryEx> pageMemoryGroupResolver, PageMemoryImpl.ThrottlingPolicy throttlingPolicy, IgniteCacheSnapshotManager snapshotMgr, DataStorageMetricsImpl persStoreMetrics, LongJVMPauseDetector longJvmPauseDetector, FailureProcessor failureProcessor, GridCacheProcessor cacheProcessor, Supplier<Integer> cpFreqDeviation) throws IgniteCheckedException
logger - Logger producer.igniteInstanceName - Ignite instance name.checkpointThreadName - Name of main checkpoint thread.wal - Write ahead log manager.workersRegistry - Workers registry.persistenceCfg - Persistence configuration.pageStoreManager - File page store manager.checkpointInapplicableChecker - Checker of checkpoints.dataRegions - Data regions.cacheGroupContexts - Cache group contexts.pageMemoryGroupResolver - Page memory resolver.throttlingPolicy - Throttling policy.snapshotMgr - Snapshot manager.persStoreMetrics - Persistence metrics.longJvmPauseDetector - Long JVM pause detector.failureProcessor - Failure processor.cacheProcessor - Cache processor.cpFreqDeviation - Distributed checkpoint frequency deviation.IgniteCheckedException - if fail.public CheckpointTimeoutLock checkpointTimeoutLock()
public void threadBuf(ThreadLocal<ByteBuffer> threadBuf)
threadBuf - new thread-local with buffers for the checkpoint threads.public void addCheckpointListener(CheckpointListener lsnr, DataRegion dataRegion)
lsnr - Listener.dataRegion - Data region for which listener is corresponded to.public void removeCheckpointListener(CheckpointListener lsnr)
lsnr - Listener.public void memoryRecoveryRecordPtr(WALPointer memoryRecoveryRecordPtr)
memoryRecoveryRecordPtr - Memory recovery record pointer.public File checkpointDirectory()
public CheckpointStatus readCheckpointStatus() throws IgniteCheckedException
IgniteCheckedException - If failed to read checkpoint status page.public <R> CheckpointProgress forceCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
reason - Reason.lsnr - Listener which will be called on finish.public CheckpointHistory checkpointHistory()
public void initializeStorage()
throws IgniteCheckedException
IgniteCheckedExceptionpublic void removeCheckpointsUntil(@Nullable
@Nullable WALPointer highBound)
throws IgniteCheckedException
highBound - Upper bound.IgniteCheckedException - If failed.public void cleanupTempCheckpointDirectory()
throws IgniteCheckedException
IgniteCheckedExceptionpublic void cleanupCheckpointDirectory()
throws IgniteCheckedException
CheckpointMarkersStorage.cpDir. The operation is necessary when local node joined to
baseline topology with different consistentId.IgniteCheckedExceptionpublic Checkpointer getCheckpointer()
public void schedulePartitionDestroy(@Nullable
@Nullable CacheGroupContext context,
int groupId,
int partId)
context - Group context. Can be null in case of crash recovery.groupId - Group ID.partId - Partition ID.public IgniteInternalFuture<Void> enableCheckpoints(boolean enable)
public void finalizeCheckpointOnRecovery(long ts,
UUID id,
WALPointer ptr,
StripedExecutor exec)
throws IgniteCheckedException
IgniteCheckedException - If failed.public boolean cancelOrWaitPartitionDestroy(int grpId,
int partId)
throws IgniteCheckedException
grpId - Group ID.partId - Partition ID.True if the request to destroy the partition was canceled.IgniteCheckedExceptionpublic void stop(boolean cancel)
cancel - Cancel flag.public void init()
public void start()
public void unblockCheckpointLock()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021