pub struct Config<T: Translator> {
pub registry: Arc<Mutex<Registry>>,
pub section_mask: u64,
pub key_len: u32,
pub translator: T,
pub pending_writes: usize,
pub replay_concurrency: usize,
pub compression: Option<u8>,
}
Expand description
Configuration for Archive
storage.
Fields§
§registry: Arc<Mutex<Registry>>
Registry for metrics.
section_mask: u64
Mask to apply to indices to determine section.
This value is index & section_mask
.
key_len: u32
Length of each key in bytes.
Archive
assumes that all keys are of the same length. This
trick is used to store data more efficiently on disk and to substantially
reduce the number of IO during initialization. If a key is provided that
is not of the correct length, an error will be returned.
translator: T
Logic to transform keys into their index representation.
Archive
assumes that all internal keys are spread uniformly across the key space.
If that is not the case, lookups may be O(n) instead of O(1).
pending_writes: usize
The number of writes to buffer in a section before forcing a sync in the journal.
If set to 0, the journal will be synced each time a new item is stored.
replay_concurrency: usize
The number of blobs to replay concurrently on initialization.
compression: Option<u8>
Optional compression level (using zstd
) to apply to data before storing.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Config<T>where
T: Freeze,
impl<T> RefUnwindSafe for Config<T>where
T: RefUnwindSafe,
impl<T> Send for Config<T>where
T: Send,
impl<T> Sync for Config<T>where
T: Sync,
impl<T> Unpin for Config<T>where
T: Unpin,
impl<T> UnwindSafe for Config<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more