pub struct CheckpointManager<S: CheckpointStorage> { /* private fields */ }Expand description
Checkpoint manager for creating and restoring checkpoints
Implementations§
Source§impl<S: CheckpointStorage> CheckpointManager<S>
impl<S: CheckpointStorage> CheckpointManager<S>
Sourcepub fn new(db: Arc<AzothDb>, storage: S, config: CheckpointConfig) -> Self
pub fn new(db: Arc<AzothDb>, storage: S, config: CheckpointConfig) -> Self
Create a new checkpoint manager
Sourcepub async fn create_checkpoint(&self) -> Result<CheckpointMetadata>
pub async fn create_checkpoint(&self) -> Result<CheckpointMetadata>
Create a checkpoint and upload to storage
Returns the checkpoint metadata including the storage identifier
Sourcepub async fn restore_checkpoint(
&self,
checkpoint_id: &str,
target_path: &Path,
) -> Result<()>
pub async fn restore_checkpoint( &self, checkpoint_id: &str, target_path: &Path, ) -> Result<()>
Restore from a checkpoint
Downloads the checkpoint from storage and restores the database
Sourcepub async fn list_checkpoints(&self) -> Result<Vec<CheckpointMetadata>>
pub async fn list_checkpoints(&self) -> Result<Vec<CheckpointMetadata>>
List all available checkpoints
Sourcepub async fn delete_checkpoint(&self, checkpoint_id: &str) -> Result<()>
pub async fn delete_checkpoint(&self, checkpoint_id: &str) -> Result<()>
Delete a checkpoint
Sourcepub async fn shutdown_checkpoint(&self) -> Result<CheckpointMetadata>
pub async fn shutdown_checkpoint(&self) -> Result<CheckpointMetadata>
Create a final checkpoint on shutdown
This creates a checkpoint with a “shutdown” marker in the metadata. Call this before closing the database to ensure a recovery point exists.
Auto Trait Implementations§
impl<S> Freeze for CheckpointManager<S>
impl<S> !RefUnwindSafe for CheckpointManager<S>
impl<S> Send for CheckpointManager<S>
impl<S> Sync for CheckpointManager<S>
impl<S> Unpin for CheckpointManager<S>
impl<S> UnsafeUnpin for CheckpointManager<S>
impl<S> !UnwindSafe for CheckpointManager<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more