Skip to main content

WalGroupCommitConfig

Struct WalGroupCommitConfig 

Source
pub struct WalGroupCommitConfig {
    pub sync_mode: WalSyncMode,
    pub group_commit_interval_ms: u64,
    pub group_commit_max_batch: usize,
}
Expand description

WAL group commit configuration

Fields§

§sync_mode: WalSyncMode

Sync mode for the WAL

§group_commit_interval_ms: u64

Maximum time to wait before flushing a group (in milliseconds) Only used when sync_mode is GroupCommit

§group_commit_max_batch: usize

Maximum number of records to batch before forcing a flush Only used when sync_mode is GroupCommit

Implementations§

Source§

impl WalGroupCommitConfig

Source

pub fn new() -> Self

Create a new group commit configuration

Source

pub fn sync_mode(self, mode: WalSyncMode) -> Self

Set the sync mode

Source

pub fn group_commit_interval_ms(self, ms: u64) -> Self

Set the group commit interval in milliseconds

Source

pub fn group_commit_max_batch(self, max: usize) -> Self

Set the maximum batch size for group commit

Source

pub fn immediate() -> Self

Enable immediate sync mode (default)

Source

pub fn group_commit() -> Self

Enable group commit mode with default settings

Source

pub fn no_sync() -> Self

Enable no-sync mode (dangerous - data loss on crash)

Source

pub fn validate(&self) -> Result<(), ConfigError>

Validate the WAL group commit configuration

§Validation Rules
  • group_commit_interval_ms: must be between 1ms and 1000ms (1 second)
  • group_commit_max_batch: must be between 1 and 100,000 records
§Errors

Returns ConfigError if validation fails

Trait Implementations§

Source§

impl Clone for WalGroupCommitConfig

Source§

fn clone(&self) -> WalGroupCommitConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WalGroupCommitConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WalGroupCommitConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.