Skip to main content

reifydb_store_multi/
config.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2025 ReifyDB
3
4use std::time::Duration;
5
6use reifydb_core::event::EventBus;
7use reifydb_runtime::actor::system::ActorSystem;
8
9use crate::hot::storage::HotStorage;
10
11#[derive(Clone)]
12pub struct MultiStoreConfig {
13	pub hot: Option<HotConfig>,
14	pub warm: Option<WarmConfig>,
15	pub cold: Option<ColdConfig>,
16	pub retention: RetentionConfig,
17	pub merge_config: MergeConfig,
18	pub event_bus: EventBus,
19	pub actor_system: ActorSystem,
20}
21
22#[derive(Clone)]
23pub struct HotConfig {
24	pub storage: HotStorage,
25}
26
27/// Warm tier configuration.
28///
29/// Placeholder for future warm tier configuration.
30#[derive(Clone, Default)]
31pub struct WarmConfig;
32
33/// Cold tier configuration.
34///
35/// Placeholder for future cold tier configuration.
36#[derive(Clone, Default)]
37pub struct ColdConfig;
38
39#[derive(Clone, Debug)]
40pub struct RetentionConfig {
41	pub hot: Duration,
42	pub warm: Duration,
43	// cold is forever (no eviction)
44}
45
46#[derive(Clone, Debug)]
47pub struct MergeConfig {
48	pub merge_threshold_rows: usize,
49	pub merge_batch_size: usize,
50	pub enable_auto_eviction: bool,
51}
52
53impl Default for RetentionConfig {
54	fn default() -> Self {
55		Self {
56			hot: Duration::from_secs(300),   // 5 minutes
57			warm: Duration::from_secs(3600), // 1 hour
58		}
59	}
60}
61
62impl Default for MergeConfig {
63	fn default() -> Self {
64		Self {
65			merge_threshold_rows: 100_000,
66			merge_batch_size: 10_000,
67			enable_auto_eviction: true,
68		}
69	}
70}