org.apache.ignite.internal.processors.cache.persistence.checkpoint

## 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
`static Pattern` `CP_FILE_NAME_PATTERN` Checkpoint file name pattern.
`File` `cpDir` Checkpoint metadata directory ("cp"), contains files with checkpoint start and end
`protected IgniteLogger` `log` Logger.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static String` `checkpointFileName(CheckpointEntry cp, CheckpointEntryType type)`
`void` `cleanupCheckpointDirectory()` Cleanup checkpoint directory from all temporary files.
`void` `cleanupTempCheckpointDirectory()` Cleanup checkpoint directory from all temporary files.
`CheckpointHistory` `history()`
`void` `initialize()` Filling internal structures with data from disk.
`void` `onCheckpointFinished(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp)` Logs and clears checkpoint history after checkpoint finish.
`CheckpointStatus` `readCheckpointStatus()`
`void` `removeCheckpointsUntil(@Nullable WALPointer highBound)` Wal truncate callback.
`CheckpointEntry` `writeCheckpointEntry(long cpTs, UUID cpId, WALPointer ptr, @Nullable CheckpointRecord rec, CheckpointEntryType type, boolean skipSync)` Writes checkpoint entry buffer `entryBuf` to specified checkpoint file with 2-phase protocol.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### CP_FILE_NAME_PATTERN

    public static final Pattern CP_FILE_NAME_PATTERN

Checkpoint file name pattern.

#### 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 IgniteCheckedException

Cleanup checkpoint directory from all temporary files.

Throws:
  `IgniteCheckedException`

#### cleanupCheckpointDirectory

    public void cleanupCheckpointDirectory()
                                    throws IgniteCheckedException

Cleanup checkpoint directory from all temporary files.

Throws:
  `IgniteCheckedException`

#### initialize

    public void initialize()
                    throws IgniteCheckedException

Filling internal structures with data from disk.

Throws:
  `IgniteCheckedException`

#### removeCheckpointsUntil

    public void removeCheckpointsUntil(@Nullable
                                       @Nullable WALPointer highBound)
                                throws IgniteCheckedException

Wal 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 IgniteCheckedException

Logs 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 buffer `entryBuf` to 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.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.1
Release Date | : December 20 2021