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) |
WALPointer |
firstCheckpointPointer() |
boolean |
hasSpace() |
void |
initialize(List<CheckpointEntry> checkpoints) |
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() |
CheckpointEntry |
lastCheckpointMarkingAsInapplicable(Integer grpId)
Prepare last checkpoint in history that will marked as inapplicable.
|
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.
|
CheckpointHistoryResult |
searchAndReserveCheckpoints(Map<Integer,Set<Integer>> groupsAndPartitions)
Finds and reserves earliest valid checkpoint for each of given groups and partitions.
|
@Nullable 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)
checkpoints
- Checkpoints.@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 lastCheckpointMarkingAsInapplicable(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.IgniteCheckedException
@Nullable public @Nullable 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.IgniteCheckedException
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021