Struct Config

Source
pub struct Config {
    pub silent: bool,
    pub snapshot_interval: u64,
    pub memory_bucket_count: usize,
    pub sync_mode: SyncMode,
    pub target_io_parallelism_snapshots: u64,
    pub target_io_parallelism_writelog: u64,
    pub target_snapshot_shard_size_bytes: usize,
    pub use_positioned_writes: bool,
}

Fields§

§silent: bool

If true, we will not write any snapshot / restore events to stdout. By default this is on as such events are rare and will be helpful to spot unexpected config or runtime issues.

§snapshot_interval: u64

The interval at which full snapshots should be created. The unit counted is the number of key-value pairs modified (created, updated or deleted) meaning if snapshot_interval is 10,000, then a snapshot will be created every 10,000 key-value pairs modified.

Notes:

  • Snapshots may be skipped if we cannot keep up with the number of changes.
  • Snapshots are created asynchronously and do not block reads or writes to the main store (except for a brief lock to create a memory data copy).
  • Snapshots are not required for the store to have basic persistence guarantees as all modifications are written to a write-ahead log first. However, regular snapshotting compacts the write-ahead log and helps keep disk usage and startup time to be bounded by O(number of keys) rather than O(number of modifications)
§memory_bucket_count: usize

The number of buckets to use for the memory store, each responsible for a part of the keyspace. This is a trade-off between memory overhead and contention avoidance in multithreaded operation. Each bucket has its own dictionary, supporting data structure and mutex.

§sync_mode: SyncMode

File system synchronization model.

§target_io_parallelism_snapshots: u64

The number of threads to use for IO operations. This includes reading and writing of snapshots and influences (but not fully determines) number of shards used.

§target_io_parallelism_writelog: u64

The number of shards to use for the write log (this is directly the file count used)

§target_snapshot_shard_size_bytes: usize

The targeted size for a snapshot shard. This is not a hard limit. This number influences (but not fully determines) number of shards used for snapshots.

§use_positioned_writes: bool

Whether to make use of positioned writes e.g. write_at() instead of seek() + write(). This uses OS specific extensions and enables higher effective concurrency for writes.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

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 Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Config

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

impl PartialEq for Config

Source§

fn eq(&self, other: &Config) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Config

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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.