Class CheckpointMarkersStorage
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointMarkersStorage
-
public class CheckpointMarkersStorage extends Object
Abstraction responsible for managing checkpoint markers storage.
-
-
Field Summary
Fields Modifier and Type Field Description static PatternCP_FILE_NAME_PATTERNCheckpoint file name pattern.FilecpDirCheckpoint metadata directory ("cp"), contains files with checkpoint start and endstatic intDFLT_IGNITE_CHECKPOINT_MAP_SNAPSHOT_THRESHOLDDefault threshold of the checkpoint quantity since the last earliest checkpoint map snapshot.static StringEARLIEST_CP_SNAPSHOT_FILEEarliest checkpoint map snapshot file name.protected IgniteLoggerlogLogger.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcheckpointFileName(CheckpointEntry cp, CheckpointEntryType type)voidcleanupCheckpointDirectory()Cleanup checkpoint directory from all temporary files.voidcleanupTempCheckpointDirectory()Cleanup checkpoint directory from all temporary files.CheckpointHistoryhistory()voidinitialize()Filling internal structures with data from disk.voidonCheckpointFinished(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp)Logs and clears checkpoint history after checkpoint finish.CheckpointStatusreadCheckpointStatus()voidremoveCheckpointsUntil(@Nullable WALPointer highBound)Wal truncate callback.CheckpointEntryremoveFromEarliestCheckpoints(Integer grpId)CheckpointEntrywriteCheckpointEntry(long cpTs, UUID cpId, WALPointer ptr, @Nullable CheckpointRecord rec, CheckpointEntryType type, boolean skipSync)Writes checkpoint entry bufferentryBufto specified checkpoint file with 2-phase protocol.
-
-
-
Field Detail
-
CP_FILE_NAME_PATTERN
public static final Pattern CP_FILE_NAME_PATTERN
Checkpoint file name pattern.
-
DFLT_IGNITE_CHECKPOINT_MAP_SNAPSHOT_THRESHOLD
public static final int DFLT_IGNITE_CHECKPOINT_MAP_SNAPSHOT_THRESHOLD
Default threshold of the checkpoint quantity since the last earliest checkpoint map snapshot.- See Also:
- Constant Field Values
-
EARLIEST_CP_SNAPSHOT_FILE
public static final String EARLIEST_CP_SNAPSHOT_FILE
Earliest checkpoint map snapshot file name.- See Also:
- Constant Field Values
-
log
protected IgniteLogger log
Logger.
-
cpDir
public final File cpDir
Checkpoint metadata directory ("cp"), contains files with checkpoint start and end
-
-
Method Detail
-
cleanupTempCheckpointDirectory
public void cleanupTempCheckpointDirectory() throws IgniteCheckedExceptionCleanup checkpoint directory from all temporary files.- Throws:
IgniteCheckedException
-
cleanupCheckpointDirectory
public void cleanupCheckpointDirectory() throws IgniteCheckedExceptionCleanup checkpoint directory from all temporary files.- Throws:
IgniteCheckedException
-
initialize
public void initialize() throws IgniteCheckedExceptionFilling internal structures with data from disk.- Throws:
IgniteCheckedException
-
removeCheckpointsUntil
public void removeCheckpointsUntil(@Nullable @Nullable WALPointer highBound) throws IgniteCheckedExceptionWal truncate callback.- Parameters:
highBound- Upper bound.- Throws:
IgniteCheckedException- If failed.
-
onCheckpointFinished
public void onCheckpointFinished(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp) throws IgniteCheckedExceptionLogs and clears checkpoint history after checkpoint finish.- Parameters:
chp- Finished checkpoint.- Throws:
IgniteCheckedException- If failed.
-
readCheckpointStatus
public CheckpointStatus readCheckpointStatus() throws IgniteCheckedException
- Returns:
- Read checkpoint status.
- Throws:
IgniteCheckedException- If failed to read checkpoint status page.
-
writeCheckpointEntry
public CheckpointEntry writeCheckpointEntry(long cpTs, UUID cpId, WALPointer ptr, @Nullable @Nullable CheckpointRecord rec, CheckpointEntryType type, boolean skipSync) throws StorageException
Writes checkpoint entry bufferentryBufto specified checkpoint file with 2-phase protocol.- Parameters:
cpTs- Checkpoint timestamp.cpId- Checkpoint id.ptr- WAL pointer containing record.rec- Checkpoint WAL record.type- Checkpoint type.- Returns:
- Checkpoint entry which represents current checkpoint by given parameters.
- Throws:
StorageException- If failed to write checkpoint entry.
-
checkpointFileName
public static String checkpointFileName(CheckpointEntry cp, CheckpointEntryType type)
- Parameters:
cp- Checkpoint entry.type- Checkpoint type.- Returns:
- Checkpoint file name.
-
history
public CheckpointHistory history()
- Returns:
- Cached checkpoint history.
-
removeFromEarliestCheckpoints
public CheckpointEntry removeFromEarliestCheckpoints(Integer grpId)
- Parameters:
grpId- Group id.- Returns:
- Checkpoint entry.
-
-