[][src]Struct pagecache::logger::Log

pub struct Log { /* fields omitted */ }

A sequential store which allows users to create reservations placed at known log offsets, used for writing persistent data structures that need to know where to find persisted bits in the future.

Methods

impl Log[src]

pub fn start(config: Config, snapshot: Snapshot) -> Result<Log>[src]

Start the log, open or create the configured file, and optionally start the periodic buffer flush thread.

pub fn start_raw_log(config: Config) -> Result<Log>[src]

Starts a log for use without a materializer.

pub fn flush(&self) -> Result<usize>[src]

Flushes any pending IO buffers to disk to ensure durability. Returns the number of bytes written during this call.

pub fn write<B>(&self, buf: B) -> Result<(Lsn, DiskPtr)> where
    B: AsRef<[u8]>, 
[src]

Write a buffer into the log. Returns the log sequence number and the file offset of the write.

pub fn iter_from(&self, lsn: Lsn) -> LogIter[src]

Return an iterator over the log, starting with a specified offset.

pub fn read(&self, lsn: Lsn, ptr: DiskPtr) -> Result<LogRead>[src]

read a buffer from the disk

pub fn stable_offset(&self) -> Lsn[src]

returns the current stable offset written to disk

pub fn make_stable(&self, lsn: Lsn) -> Result<usize>[src]

blocks until the specified log sequence number has been made stable on disk. Returns the number of bytes written during this call.

pub fn reserve<'a>(&'a self, raw_buf: &[u8]) -> Result<Reservation<'a>>[src]

Tries to claim a reservation for writing a buffer to a particular location in stable storge, which may either be completed or aborted later. Useful for maintaining linearizability across CAS operations that may need to persist part of their operation.

Trait Implementations

impl Send for Log[src]

impl Drop for Log[src]

impl Debug for Log[src]

Auto Trait Implementations

impl Sync for Log

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.