pub struct DurableBlockStore { /* private fields */ }Expand description
Durable block store with WAL-backed persistence
Provides ACID guarantees through write-ahead logging:
- Writes are first logged to WAL, then synced
- On crash, replays WAL to recover state
- Checkpoint mechanism to truncate WAL
Implementations§
Source§impl DurableBlockStore
impl DurableBlockStore
Sourcepub fn write_block(&self, txn_id: u64, data: &[u8]) -> Result<BlockRef>
pub fn write_block(&self, txn_id: u64, data: &[u8]) -> Result<BlockRef>
Write a block with WAL durability
- Writes to WAL and fsyncs
- Updates in-memory store
- Marks page as dirty (will be flushed at checkpoint)
Sourcepub fn checkpoint(&self) -> Result<u64>
pub fn checkpoint(&self) -> Result<u64>
Create a checkpoint
- Flushes all dirty pages to data file
- Writes checkpoint marker to WAL
- Updates checkpoint LSN (WAL can be truncated before this)
Sourcepub fn recover(&mut self) -> Result<RecoveryStats>
pub fn recover(&mut self) -> Result<RecoveryStats>
Recover from WAL after crash
Replays all committed transactions from the last checkpoint.
Sourcepub fn stats(&self) -> DurableBlockStoreStats
pub fn stats(&self) -> DurableBlockStoreStats
Get statistics
Auto Trait Implementations§
impl !Freeze for DurableBlockStore
impl !RefUnwindSafe for DurableBlockStore
impl Send for DurableBlockStore
impl Sync for DurableBlockStore
impl Unpin for DurableBlockStore
impl UnwindSafe for DurableBlockStore
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more