pub struct WalRing { /* private fields */ }Expand description
Ring buffer WAL
Implementations§
Source§impl WalRing
impl WalRing
Sourcepub fn create(path: impl AsRef<Path>, region: Region) -> Result<Self>
pub fn create(path: impl AsRef<Path>, region: Region) -> Result<Self>
Create a new ring buffer WAL
Sourcepub fn open(path: impl AsRef<Path>, region: Region) -> Result<Self>
pub fn open(path: impl AsRef<Path>, region: Region) -> Result<Self>
Open existing ring buffer WAL and recover
Sourcepub fn set_checkpoint(&self, lsn: Lsn) -> Result<()>
pub fn set_checkpoint(&self, lsn: Lsn) -> Result<()>
Set checkpoint LSN (for compaction)
Sourcepub fn compact(&self) -> Result<()>
pub fn compact(&self) -> Result<()>
Compact WAL by removing entries before checkpoint Note: In a ring buffer, this just means we can overwrite them on next wrap
Sourcepub fn set_batch_timeout(&self, timeout: Duration)
pub fn set_batch_timeout(&self, timeout: Duration)
Set batch timeout for group commit
Auto Trait Implementations§
impl Freeze for WalRing
impl !RefUnwindSafe for WalRing
impl Send for WalRing
impl Sync for WalRing
impl Unpin for WalRing
impl !UnwindSafe for WalRing
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