Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions crates/core/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ pub struct RedbIndexConfig {
}

/// Configuration for the Fjall index backend.
#[derive(Serialize, Deserialize, Clone, Debug, Default)]
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct FjallIndexConfig {
/// Optional path override. If relative, resolved from storage root.
/// If not specified, defaults to `<storage.path>/index`.
Expand All @@ -360,23 +360,37 @@ pub struct FjallIndexConfig {
/// Size (in MB) of memory allocated for caching.
#[serde(default)]
pub cache: Option<usize>,
/// Maximum journal size in MB.
/// Maximum journal size in MB (default: 1024).
#[serde(default)]
pub max_journal_size: Option<usize>,
/// Flush journal after each commit.
/// Flush journal after each commit (default: false).
#[serde(default)]
pub flush_on_commit: Option<bool>,
/// L0 compaction threshold (default: 4, lower = more aggressive).
/// L0 compaction threshold (default: 8, lower = more aggressive).
#[serde(default)]
pub l0_threshold: Option<u8>,
/// Number of background compaction worker threads.
/// Number of background compaction worker threads (default: 8).
#[serde(default)]
pub worker_threads: Option<usize>,
/// Memtable size in MB before flush (default: 64).
/// Memtable size in MB before flush (default: 128).
#[serde(default)]
pub memtable_size_mb: Option<usize>,
}

impl Default for FjallIndexConfig {
fn default() -> Self {
Self {
path: None,
cache: None,
max_journal_size: Some(1024),
flush_on_commit: Some(false),
l0_threshold: Some(8),
worker_threads: Some(8),
memtable_size_mb: Some(128),
}
}
}

/// Index store configuration.
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(tag = "backend", rename_all = "lowercase")]
Expand Down
Loading