pub struct RecoveryManager { /* private fields */ }Expand description
Manages WAL recovery after crash or restart
Implementations§
Source§impl RecoveryManager
impl RecoveryManager
Sourcepub fn new(config: WalConfig) -> Result<RecoveryManager, Error>
pub fn new(config: WalConfig) -> Result<RecoveryManager, Error>
Create a new recovery manager with the given configuration
Sourcepub fn recover(&self) -> Result<Vec<WalRecord>, Error>
pub fn recover(&self) -> Result<Vec<WalRecord>, Error>
Recover records from WAL
This method:
- Reads all records from all WAL segments
- Tracks transaction boundaries
- Only returns records from committed transactions
- For records outside transactions, returns them directly
Returns a vector of recovered records in order
Sourcepub fn recover_with_markers(&self) -> Result<Vec<WalRecord>, Error>
pub fn recover_with_markers(&self) -> Result<Vec<WalRecord>, Error>
Recover records with transaction markers included
Unlike recover(), this method returns all records including
BEGIN_TX and COMMIT_TX markers for committed transactions.
This is useful for replaying the exact WAL state.
Sourcepub fn get_stats(&self) -> Result<RecoveryStats, Error>
pub fn get_stats(&self) -> Result<RecoveryStats, Error>
Get statistics about the WAL
Auto Trait Implementations§
impl Freeze for RecoveryManager
impl RefUnwindSafe for RecoveryManager
impl Send for RecoveryManager
impl Sync for RecoveryManager
impl Unpin for RecoveryManager
impl UnwindSafe for RecoveryManager
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