public class LightweightCheckpointManager extends Object
CheckpointManager this checkpoint ensures that
all pages marked dirty under checkpointTimeoutLock() will be consistently saved to disk.
But unlike CheckpointManager lightweight checkpoint doesn't store any checkpoint markers to disk
nor write cp-related records to WAL log.
This allows to use it in situations where no recovery is needed after crush in the middle of checkpoint
but work can simply be replayed from the beginning.
Such situations include defragmentation and node recovery after crush
(regular sharp checkpoint cannot be used during recovery).| Constructor and Description |
|---|
LightweightCheckpointManager(Function<Class<?>,IgniteLogger> logger,
String igniteInstanceName,
String checkpointThreadName,
WorkersRegistry workersRegistry,
DataStorageConfiguration persistenceCfg,
Supplier<Collection<DataRegion>> dataRegions,
IgniteThrowableFunction<Integer,PageMemoryEx> pageMemoryGroupResolver,
PageMemoryImpl.ThrottlingPolicy throttlingPolicy,
IgniteCacheSnapshotManager snapshotMgr,
DataStorageMetricsImpl persStoreMetrics,
LongJVMPauseDetector longJvmPauseDetector,
FailureProcessor failureProcessor,
GridCacheProcessor cacheProcessor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCheckpointListener(CheckpointListener lsnr,
DataRegion dataRegion) |
boolean |
cancelOrWaitPartitionDestroy(int grpId,
int partId) |
CheckpointTimeoutLock |
checkpointTimeoutLock() |
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() |
void |
init()
Initialize the checkpoint and prepare it to work.
|
void |
memoryRecoveryRecordPtr(WALPointer memoryRecoveryRecordPtr) |
void |
removeCheckpointListener(CheckpointListener lsnr) |
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 LightweightCheckpointManager(Function<Class<?>,IgniteLogger> logger, String igniteInstanceName, String checkpointThreadName, WorkersRegistry workersRegistry, DataStorageConfiguration persistenceCfg, Supplier<Collection<DataRegion>> dataRegions, IgniteThrowableFunction<Integer,PageMemoryEx> pageMemoryGroupResolver, PageMemoryImpl.ThrottlingPolicy throttlingPolicy, IgniteCacheSnapshotManager snapshotMgr, DataStorageMetricsImpl persStoreMetrics, LongJVMPauseDetector longJvmPauseDetector, FailureProcessor failureProcessor, GridCacheProcessor cacheProcessor) throws IgniteCheckedException
logger - Logger producer.igniteInstanceName - Ignite instance name.checkpointThreadName - Name of main checkpoint thread.workersRegistry - Workers registry.persistenceCfg - Persistence configuration.dataRegions - Data regions.pageMemoryGroupResolver - Page memory resolver.throttlingPolicy - Throttling policy.snapshotMgr - Snapshot manager.persStoreMetrics - Persistence metrics.longJvmPauseDetector - Long JVM pause detector.failureProcessor - Failure processor.cacheProcessor - Cache processor.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 - public void removeCheckpointListener(CheckpointListener lsnr)
lsnr - Listener.public void memoryRecoveryRecordPtr(WALPointer memoryRecoveryRecordPtr)
memoryRecoveryRecordPtr - Memory recovery record pointer.public <R> CheckpointProgress forceCheckpoint(String reason, IgniteInClosure<? super IgniteInternalFuture<R>> lsnr)
reason - Reason.lsnr - Listener which will be called on finish.public 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.1 Release Date : December 20 2021