pub struct EventStoreConfig {
pub storage_dir: Option<PathBuf>,
pub snapshot_config: SnapshotConfig,
pub wal_dir: Option<PathBuf>,
pub wal_config: WALConfig,
pub compaction_config: CompactionConfig,
pub schema_registry_config: SchemaRegistryConfig,
pub system_data_dir: Option<PathBuf>,
pub bootstrap_tenant: Option<String>,
pub cache_byte_budget: Option<u64>,
pub checkpoint_interval_secs: Option<u64>,
}Expand description
Configuration for EventStore
Fields§
§storage_dir: Option<PathBuf>Optional directory for persistent Parquet storage (v0.2 feature)
snapshot_config: SnapshotConfigSnapshot configuration (v0.2 feature)
wal_dir: Option<PathBuf>Optional directory for WAL (Write-Ahead Log) (v0.2 feature)
wal_config: WALConfigWAL configuration (v0.2 feature)
compaction_config: CompactionConfigCompaction configuration (v0.2 feature)
schema_registry_config: SchemaRegistryConfigSchema registry configuration (v0.5 feature)
system_data_dir: Option<PathBuf>Optional directory for system metadata storage (dogfood feature).
When set, operational metadata (tenants, config, audit) is stored
using AllSource’s own event store rather than an external database.
Defaults to {storage_dir}/__system/ when storage_dir is set.
bootstrap_tenant: Option<String>Name of the default tenant to auto-create on first boot.
cache_byte_budget: Option<u64>In-memory cache budget in bytes (Step 3). When the resident
total exceeds this after a load, the LRU tenant is evicted
until the cache fits. None (the default in tests) disables
the budget — every loaded tenant stays resident. Production
reads this from the ALLSOURCE_CACHE_BYTES env var; see
from_env.
checkpoint_interval_secs: Option<u64>Cadence of the runtime checkpoint loop, in seconds (Step 6). Each tick flushes pending Parquet batches and, on success, truncates the WAL up through the checkpoint. This bounds dirty-restart replay time to one interval of writes regardless of total dataset size.
None disables the loop — the WAL still grows but is only
truncated at boot, which is the pre-Step-6 behavior. Tests
default to None; production reads
ALLSOURCE_CHECKPOINT_INTERVAL_SECONDS (default 60s) via
from_env_vars.
Implementations§
Source§impl EventStoreConfig
impl EventStoreConfig
Sourcepub fn with_persistence(storage_dir: impl Into<PathBuf>) -> Self
pub fn with_persistence(storage_dir: impl Into<PathBuf>) -> Self
Create config with persistent storage enabled
Sourcepub fn with_snapshots(snapshot_config: SnapshotConfig) -> Self
pub fn with_snapshots(snapshot_config: SnapshotConfig) -> Self
Create config with custom snapshot settings
Sourcepub fn with_wal(wal_dir: impl Into<PathBuf>, wal_config: WALConfig) -> Self
pub fn with_wal(wal_dir: impl Into<PathBuf>, wal_config: WALConfig) -> Self
Create config with WAL enabled
Sourcepub fn with_all(
storage_dir: impl Into<PathBuf>,
snapshot_config: SnapshotConfig,
) -> Self
pub fn with_all( storage_dir: impl Into<PathBuf>, snapshot_config: SnapshotConfig, ) -> Self
Create config with both persistence and snapshots
Sourcepub fn production(
storage_dir: impl Into<PathBuf>,
wal_dir: impl Into<PathBuf>,
snapshot_config: SnapshotConfig,
wal_config: WALConfig,
compaction_config: CompactionConfig,
) -> Self
pub fn production( storage_dir: impl Into<PathBuf>, wal_dir: impl Into<PathBuf>, snapshot_config: SnapshotConfig, wal_config: WALConfig, compaction_config: CompactionConfig, ) -> Self
Create production config with all features enabled
Sourcepub fn effective_system_data_dir(&self) -> Option<PathBuf>
pub fn effective_system_data_dir(&self) -> Option<PathBuf>
Resolve the effective system data directory.
If explicitly set, returns that. Otherwise, derives from storage_dir. Returns None if neither is configured (in-memory mode).
Sourcepub fn from_env() -> (Self, &'static str)
pub fn from_env() -> (Self, &'static str)
Build config from environment variables.
Reads ALLSOURCE_DATA_DIR, ALLSOURCE_STORAGE_DIR, ALLSOURCE_WAL_DIR,
and ALLSOURCE_WAL_ENABLED to determine persistence mode.
Returns (config, description) where description is a human-readable
summary of the persistence mode for logging.
Sourcepub fn from_env_vars(
data_dir: Option<String>,
explicit_storage_dir: Option<String>,
explicit_wal_dir: Option<String>,
wal_enabled_var: Option<String>,
cache_bytes_var: Option<String>,
snapshot_interval_var: Option<String>,
retention_system_days_var: Option<String>,
checkpoint_interval_var: Option<String>,
) -> (Self, &'static str)
pub fn from_env_vars( data_dir: Option<String>, explicit_storage_dir: Option<String>, explicit_wal_dir: Option<String>, wal_enabled_var: Option<String>, cache_bytes_var: Option<String>, snapshot_interval_var: Option<String>, retention_system_days_var: Option<String>, checkpoint_interval_var: Option<String>, ) -> (Self, &'static str)
Build config from explicit env-var values (testable without mutating process env).
Trait Implementations§
Source§impl Clone for EventStoreConfig
impl Clone for EventStoreConfig
Source§fn clone(&self) -> EventStoreConfig
fn clone(&self) -> EventStoreConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more