Skip to main content

ChronixConfigBuilder

Struct ChronixConfigBuilder 

Source
pub struct ChronixConfigBuilder { /* private fields */ }
Expand description

Builder for ChronixConfig with validation on build().

Implementations§

Source§

impl ChronixConfigBuilder

Source

pub fn data_dir(self, path: impl Into<PathBuf>) -> Self

Set the data directory path (required).

Source

pub fn wal_fsync_policy(self, policy: FsyncPolicy) -> Self

Set the WAL fsync policy.

Source

pub fn wal_max_file_size(self, size: usize) -> Self

Set the maximum WAL file size.

Source

pub fn wal_max_unflushed(self, count: usize) -> Self

Set the maximum number of unflushed WAL files.

Source

pub fn memtable_flush_threshold(self, size: usize) -> Self

Set the memtable flush threshold in bytes.

Source

pub fn max_memtable_memory(self, size: usize) -> Self

Set the maximum total memtable memory.

Source

pub fn shard_duration(self, duration: Duration) -> Self

Set the time-shard duration.

Source

pub fn retention(self, duration: Option<Duration>) -> Self

Set the retention period (None for infinite).

Source

pub fn compression(self, codec: CompressionCodec) -> Self

Set the compression codec.

Source

pub fn zstd_level(self, level: i32) -> Self

Set the Zstd compression level for new segments (1–22).

Source

pub fn zstd_dict_training(self, enabled: bool) -> Self

Enable Zstd dictionary training for new segments.

Source

pub fn float_encoding(self, encoding: FloatEncoding) -> Self

Set the float encoding algorithm.

Source

pub fn ooo_shard_tolerance(self, tolerance: u32) -> Self

Set the out-of-order shard tolerance (in shard units).

Source

pub fn measurement_retention( self, measurement: impl Into<String>, duration: Duration, ) -> Self

Add a per-measurement retention override.

Source

pub fn compaction_concurrency(self, concurrency: usize) -> Self

Set the maximum concurrent compaction tasks.

Source

pub fn field_encryption(self, settings: FieldEncryption) -> Self

Declare which columns are encrypted and where their keys live.

See FieldEncryption. The declaration is checked at build; the keys themselves are resolved from the environment when the database is opened, so a missing variable is a startup error rather than a column that silently writes plaintext.

Source

pub fn checkpoints(self, settings: Checkpoints) -> Self

Take a checkpoint on a schedule — see Checkpoints.

Source

pub fn maintenance_interval(self, interval: Duration) -> Self

Set how often the built-in maintenance thread compacts, materialises rollups and enforces retention. Duration::ZERO disables the periodic passes.

Source

pub fn enable_last_value_cache(self, enable: bool) -> Self

Enable or disable the Last Value Cache.

Source

pub fn lvc_measurements(self, measurements: HashSet<String>) -> Self

Restrict the Last Value Cache to specific measurements.

When set, only the listed measurements participate in the LVC. Requires enable_last_value_cache(true) to have any effect.

Source

pub fn cdc_capacity(self, events: usize) -> Self

CDC event-bus capacity, in events.

The ring is allocated on the first subscription; a deployment that never reads the CDC stream pays nothing for this.

Source

pub fn segment_cache_size(self, size: usize) -> Self

Set the segment cache size in bytes.

Source

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

Set the maximum series cardinality per shard.

Source

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

Set the maximum query result size in bytes (0 = unlimited).

Source

pub fn per_query_memory_limit(self, limit: usize) -> Self

Set the per-query memory budget in bytes (0 = unlimited).

Source

pub fn query_timeout(self, timeout: Duration) -> Self

Set the query execution timeout (Duration::ZERO = no timeout).

Source

pub fn analytics(self, config: AnalyticsConfig) -> Self

Set the analytics engine configuration.

Source

pub fn soft_delete_ttl(self, ttl: Option<Duration>) -> Self

Set the soft-delete TTL for dropped measurements.

When set, drop_measurement marks the measurement as pending deletion instead of immediately removing data.

Source

pub fn future_write_tolerance(self, tolerance: Duration) -> Self

Set how far ahead of the wall clock a timestamp may be (default: 1 h).

Source

pub fn build(self) -> Result<ChronixConfig, ConfigError>

Build the configuration, validating all constraints.

§Errors

Returns ConfigError if a required field is missing or a constraint is violated.

Trait Implementations§

Source§

impl Clone for ChronixConfigBuilder

Source§

fn clone(&self) -> ChronixConfigBuilder

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ChronixConfigBuilder

Source§

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

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

impl Default for ChronixConfigBuilder

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> 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, 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<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