pub enum CheckpointPolicy {
Manual,
SizeRatio {
factor: u32,
},
}Expand description
Auto-checkpoint policy: decides when a dirty commit should fold the delta-log into a fresh base generation, bounding the log tail that recovery must replay.
The default is size-ratio: trigger when the delta-log grows past factor
times the live base size (factor configurable). CheckpointPolicy::Manual
disables auto-triggering entirely (checkpoint only via
Database::checkpoint/Database::compact).
§Performance
Copying this value is O(1).
Variants§
Manual
Never auto-checkpoint; the caller drives Database::checkpoint.
SizeRatio
Auto-checkpoint after a dirty commit once the delta-log exceeds factor
times the live base size (a small floor guards a tiny/empty base so the
gen-0 store does not checkpoint on its first commit).
Implementations§
Source§impl CheckpointPolicy
impl CheckpointPolicy
Sourcepub const DEFAULT_FACTOR: u32 = 4
pub const DEFAULT_FACTOR: u32 = 4
The default auto-checkpoint factor K: fold when the delta-log exceeds
four times the live base size.
Trait Implementations§
Source§impl Clone for CheckpointPolicy
impl Clone for CheckpointPolicy
Source§fn clone(&self) -> CheckpointPolicy
fn clone(&self) -> CheckpointPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CheckpointPolicy
Source§impl Debug for CheckpointPolicy
impl Debug for CheckpointPolicy
Source§impl Default for CheckpointPolicy
impl Default for CheckpointPolicy
Source§fn default() -> Self
fn default() -> Self
The default policy: size-ratio with CheckpointPolicy::DEFAULT_FACTOR.
§Performance
This function is O(1).
impl Eq for CheckpointPolicy
Source§impl PartialEq for CheckpointPolicy
impl PartialEq for CheckpointPolicy
Source§fn eq(&self, other: &CheckpointPolicy) -> bool
fn eq(&self, other: &CheckpointPolicy) -> bool
self and other values to be equal, and is used by ==.