public class CheckpointHistory extends Object
CheckpointEntries. Data is loaded
from corresponding checkpoint directory. This directory holds files for checkpoint start and end.| Modifier and Type | Field and Description |
|---|---|
static int |
DFLT_PDS_MAX_CHECKPOINT_MEMORY_HISTORY_SIZE |
| Modifier and Type | Method and Description |
|---|---|
void |
addCheckpoint(CheckpointEntry entry,
Map<Integer,CacheState> cacheStates)
Adds checkpoint entry after the corresponding WAL record has been written to WAL.
|
Collection<Long> |
checkpoints() |
Collection<Long> |
checkpoints(boolean descending) |
EarliestCheckpointMapSnapshot |
earliestCheckpointsMapSnapshot()
Creates a snapshot of
earliestCp map. |
WALPointer |
firstCheckpointPointer() |
boolean |
hasSpace() |
void |
initialize(List<CheckpointEntry> checkpoints,
EarliestCheckpointMapSnapshot snapshot) |
boolean |
isCheckpointApplicableForGroup(int grpId,
CheckpointEntry cp)
Checkpoint is not applicable when: 1) WAL was disabled somewhere after given checkpoint. 2) Checkpoint doesn't
contain specified
grpId. |
@Nullable CheckpointEntry |
lastCheckpoint() |
List<CheckpointEntry> |
onCheckpointFinished(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp)
Logs and clears checkpoint history after checkpoint finish.
|
List<CheckpointEntry> |
onWalTruncated(WALPointer highBound)
Clears checkpoint history after WAL truncation.
|
List<CheckpointEntry> |
removeCheckpoints(int countToRemove)
Removes checkpoints from history.
|
CheckpointEntry |
removeFromEarliestCheckpoints(Integer grpId)
Removes last checkpoint in history from the earliest checkpoints map by group id and returns the latest
checkpoint in the history.
|
CheckpointHistoryResult |
searchAndReserveCheckpoints(Map<Integer,Set<Integer>> groupsAndPartitions)
Finds and reserves earliest valid checkpoint for each of given groups and partitions.
|
Map<GroupPartitionId,CheckpointEntry> |
searchCheckpointEntry(Map<T2<Integer,Integer>,Long> searchCntrMap)
Tries to search for a WAL pointer for the given partition counter start.
|
@Nullable WALPointer |
searchEarliestWalPointer(int grpId,
Map<Integer,Long> partsCounter,
long margin)
Search the earliest WAL pointer for particular group, matching by counter for partitions.
|
public static final int DFLT_PDS_MAX_CHECKPOINT_MEMORY_HISTORY_SIZE
public void initialize(List<CheckpointEntry> checkpoints, EarliestCheckpointMapSnapshot snapshot)
checkpoints - Checkpoints.snapshot - Earliest checkpoint map snapshot.@Nullable public @Nullable CheckpointEntry lastCheckpoint()
public WALPointer firstCheckpointPointer()
null.public Collection<Long> checkpoints(boolean descending)
public Collection<Long> checkpoints()
public void addCheckpoint(CheckpointEntry entry, Map<Integer,CacheState> cacheStates)
entry - Entry to add.cacheStates - Cache states map.public CheckpointEntry removeFromEarliestCheckpoints(Integer grpId)
grpId - Group id.public boolean hasSpace()
true if there is space for next checkpoint.public List<CheckpointEntry> onWalTruncated(WALPointer highBound)
highBound - Upper bound.public List<CheckpointEntry> removeCheckpoints(int countToRemove)
public List<CheckpointEntry> onCheckpointFinished(org.apache.ignite.internal.processors.cache.persistence.checkpoint.Checkpoint chp)
chp - Finished checkpoint.@Nullable public @Nullable WALPointer searchEarliestWalPointer(int grpId, Map<Integer,Long> partsCounter, long margin) throws IgniteCheckedException
grpId - Group id.partsCounter - Partition mapped to update counter.margin - Margin pointer.IgniteCheckedExceptionpublic Map<GroupPartitionId,CheckpointEntry> searchCheckpointEntry(Map<T2<Integer,Integer>,Long> searchCntrMap)
searchCntrMap - Search map contains (Group Id, partition, counter).public CheckpointHistoryResult searchAndReserveCheckpoints(Map<Integer,Set<Integer>> groupsAndPartitions)
groupsAndPartitions - Groups and partitions to find and reserve earliest valid checkpoint.public boolean isCheckpointApplicableForGroup(int grpId,
CheckpointEntry cp)
throws IgniteCheckedException
grpId.grpId - Group ID.cp - Checkpoint.IgniteCheckedExceptionpublic EarliestCheckpointMapSnapshot earliestCheckpointsMapSnapshot()
earliestCp map.
Guarded by checkpoint read lock.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023