Skip to main content

WalBackendAdapter

Struct WalBackendAdapter 

Source
pub struct WalBackendAdapter<F: VfsFile> { /* private fields */ }

Implementations§

Source§

impl<F: VfsFile> WalBackendAdapter<F>

Source

pub fn new(wal: WalFile<F>) -> Self

Wrap an existing WalFile in the adapter (FEC disabled).

Source

pub fn with_fec_hook(wal: WalFile<F>, hook: FecCommitHook) -> Self

Wrap an existing WalFile with an FEC commit hook.

Source

pub fn into_inner(self) -> WalFile<F>

Consume the adapter and return the inner WalFile.

Source

pub fn inner(&self) -> &WalFile<F>

Borrow the inner WalFile.

Source

pub fn inner_mut(&mut self) -> &mut WalFile<F>

Mutably borrow the inner WalFile.

Invalidates the publication plane since the caller may mutate WAL state.

Source

pub fn take_fec_pending(&mut self) -> Vec<FecCommitResult>

Take any pending FEC commit results for sidecar persistence.

Source

pub fn fec_enabled(&self) -> bool

Whether FEC encoding is active.

Source

pub fn fec_discard(&mut self)

Discard buffered FEC pages (e.g. on transaction rollback).

Trait Implementations§

Source§

impl<F: VfsFile> WalBackend for WalBackendAdapter<F>

Source§

fn begin_transaction(&mut self, cx: &Cx) -> Result<()>

Prepare WAL state for a newly-started transaction. Read more
Source§

fn append_frame( &mut self, cx: &Cx, page_number: u32, page_data: &[u8], db_size_if_commit: u32, ) -> Result<()>

Append a single frame to the WAL. Read more
Source§

fn append_frames(&mut self, cx: &Cx, frames: &[WalFrameRef<'_>]) -> Result<()>

Append a batch of frames to the WAL. Read more
Source§

fn prepare_append_frames( &mut self, frames: &[WalFrameRef<'_>], ) -> Result<Option<PreparedWalFrameBatch>>

Prepare a batch of frames for a later append. Read more
Source§

fn finalize_prepared_frames( &mut self, _cx: &Cx, prepared: &mut PreparedWalFrameBatch, ) -> Result<()>

Optionally finalize a prepared batch before the serialized append. Read more
Source§

fn append_prepared_frames( &mut self, cx: &Cx, prepared: &mut PreparedWalFrameBatch, ) -> Result<()>

Append a previously prepared frame batch. Read more
Source§

fn read_page(&mut self, cx: &Cx, page_number: u32) -> Result<Option<Vec<u8>>>

Look up the latest version of a page in the current visible WAL snapshot. Read more
Source§

fn committed_txns_since_page( &mut self, cx: &Cx, page_number: u32, ) -> Result<u64>

Count committed transactions that occur after the latest committed frame for page_number in the current visible WAL snapshot. Read more
Source§

fn committed_txn_count(&mut self, cx: &Cx) -> Result<u64>

Count committed transactions visible in the current WAL snapshot. Read more
Source§

fn sync(&mut self, cx: &Cx) -> Result<()>

Sync the WAL file to stable storage.
Source§

fn frame_count(&self) -> usize

Number of valid frames currently in the WAL.
Source§

fn checkpoint( &mut self, cx: &Cx, mode: CheckpointMode, writer: &mut dyn CheckpointPageWriter, backfilled_frames: u32, oldest_reader_frame: Option<u32>, ) -> Result<CheckpointResult>

Run a checkpoint to transfer frames from the WAL to the database. Read more

Auto Trait Implementations§

§

impl<F> Freeze for WalBackendAdapter<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for WalBackendAdapter<F>
where F: RefUnwindSafe,

§

impl<F> Send for WalBackendAdapter<F>

§

impl<F> Sync for WalBackendAdapter<F>

§

impl<F> Unpin for WalBackendAdapter<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for WalBackendAdapter<F>
where F: UnsafeUnpin,

§

impl<F> UnwindSafe for WalBackendAdapter<F>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, _span: NoopSpan) -> Self

Instruments this future with a span (no-op when disabled).
Source§

fn in_current_span(self) -> Self

Instruments this future with the current span (no-op when disabled).
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more