pub struct CheckpointState {
pub index_metadata: IndexMetadata,
pub log_metadata: LogMetadata,
pub checkpoint_type: CheckpointType,
pub index_checkpoint_started: AtomicBool,
pub index_checkpoint_completed: AtomicBool,
pub log_flush_started: AtomicBool,
pub log_flush_completed: AtomicBool,
pub persistence_callback_invoked: AtomicBool,
pub pending_persistence_calls: AtomicU64,
pub prev_version: u32,
pub is_incremental: bool,
}Expand description
State of an active checkpoint operation
Fields§
§index_metadata: IndexMetadataIndex metadata
log_metadata: LogMetadataLog metadata
checkpoint_type: CheckpointTypeCheckpoint type
index_checkpoint_started: AtomicBoolIndex checkpoint started
index_checkpoint_completed: AtomicBoolIndex checkpoint completed
log_flush_started: AtomicBoolLog flush started
log_flush_completed: AtomicBoolLog flush completed
persistence_callback_invoked: AtomicBoolPersistence callback invoked
pending_persistence_calls: AtomicU64Number of pending persistence calls
prev_version: u32Previous version (for incremental checkpoints)
is_incremental: boolWhether this is an incremental checkpoint
Implementations§
Source§impl CheckpointState
impl CheckpointState
Sourcepub fn new(checkpoint_type: CheckpointType) -> Self
pub fn new(checkpoint_type: CheckpointType) -> Self
Create a new checkpoint state
Sourcepub fn new_incremental(prev_state: &CheckpointState) -> Self
pub fn new_incremental(prev_state: &CheckpointState) -> Self
Create an incremental checkpoint state from a previous snapshot state
Sourcepub fn token(&self) -> CheckpointToken
pub fn token(&self) -> CheckpointToken
Get the checkpoint token
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check if checkpoint is complete
Sourcepub fn is_incremental_checkpoint(&self) -> bool
pub fn is_incremental_checkpoint(&self) -> bool
Check if this is an incremental checkpoint
Sourcepub fn start_index_checkpoint(&self) -> bool
pub fn start_index_checkpoint(&self) -> bool
Mark index checkpoint as started
Sourcepub fn complete_index_checkpoint(&self)
pub fn complete_index_checkpoint(&self)
Mark index checkpoint as completed
Sourcepub fn start_log_flush(&self) -> bool
pub fn start_log_flush(&self) -> bool
Mark log flush as started
Sourcepub fn complete_log_flush(&self)
pub fn complete_log_flush(&self)
Mark log flush as completed
Sourcepub fn increment_pending(&self)
pub fn increment_pending(&self)
Increment pending persistence calls
Sourcepub fn decrement_pending(&self) -> bool
pub fn decrement_pending(&self) -> bool
Decrement pending persistence calls
Returns true if this was the last pending call
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if there are pending persistence calls