Skip to main content

reifydb_core/
default.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4pub const TESTING: bool = cfg!(feature = "testing");
5
6pub mod query {
7	use reifydb_value::byte_size::ByteSize;
8
9	pub const ORACLE_WINDOW_SIZE: u64 = 500;
10	pub const ORACLE_WINDOW_SIZE_TESTING: u64 = 16;
11
12	pub const ROW_BATCH_SIZE: u16 = 128;
13	pub const ROW_BATCH_SIZE_TESTING: u16 = 4;
14
15	pub const MEMORY_LIMIT: ByteSize = ByteSize::from_gib(1);
16	pub const MEMORY_LIMIT_TESTING: ByteSize = ByteSize::from_mib(1);
17}
18
19pub mod retention {
20	use reifydb_value::value::duration::Duration;
21
22	pub const EVICT_INTERVAL: Duration = Duration::from_seconds_const(60);
23	pub const EVICT_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
24
25	pub const EVICT_BATCH_SIZE: u64 = 1024;
26	pub const EVICT_BATCH_SIZE_TESTING: u64 = 4;
27
28	pub const EVICT_MAX_BATCHES_PER_TICK: u64 = 8;
29	pub const EVICT_MAX_BATCHES_PER_TICK_TESTING: u64 = 2;
30
31	pub const STARTUP_GRACE: Duration = Duration::from_seconds_const(300);
32	pub const STARTUP_GRACE_TESTING: Duration = Duration::from_seconds_const(300);
33
34	pub const MAX_HORIZON_FLOOR: Duration = Duration::from_hours_const(7 * 24);
35	pub const MAX_HORIZON_FLOOR_TESTING: Duration = Duration::from_hours_const(7 * 24);
36
37	pub const EPOCH_BUCKET_INTERVAL: Duration = Duration::from_seconds_const(60);
38	pub const EPOCH_BUCKET_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
39
40	pub const HISTORICAL_GC_BATCH_SIZE: u64 = 50_000;
41	pub const HISTORICAL_GC_BATCH_SIZE_TESTING: u64 = 16;
42
43	pub const HISTORICAL_GC_INTERVAL: Duration = Duration::from_seconds_const(30);
44	pub const HISTORICAL_GC_INTERVAL_TESTING: Duration = Duration::from_seconds_const(30);
45}
46
47pub mod cdc {
48	use reifydb_value::{byte_size::ByteSize, value::duration::Duration};
49
50	pub const TTL: Option<Duration> = None;
51	pub const TTL_TESTING: Option<Duration> = None;
52
53	pub const TTL_SCAN_INTERVAL: Duration = Duration::from_seconds_const(30);
54	pub const TTL_SCAN_INTERVAL_TESTING: Duration = Duration::from_seconds_const(30);
55
56	pub const TTL_SCAN_BATCH_SIZE: u64 = 8192;
57	pub const TTL_SCAN_BATCH_SIZE_TESTING: u64 = 16;
58
59	pub const WAL_AUTOCHECKPOINT_PAGES: u64 = 1_000_000;
60	pub const WAL_AUTOCHECKPOINT_PAGES_TESTING: u64 = 64;
61
62	pub const COMMIT_BUFFER: ByteSize = ByteSize::from_mib(256);
63	pub const COMMIT_BUFFER_TESTING: ByteSize = ByteSize::from_kib(64);
64
65	pub const BLOCK_CUT: ByteSize = ByteSize::from_mib(4);
66	pub const BLOCK_CUT_TESTING: ByteSize = ByteSize::from_kib(4);
67
68	pub const READ_BUFFER: ByteSize = ByteSize::from_mib(256);
69	pub const READ_BUFFER_TESTING: ByteSize = ByteSize::from_kib(64);
70
71	pub const CONSUME_WAIT_TIMEOUT: Duration = Duration::from_seconds_const(30);
72	pub const CONSUME_WAIT_TIMEOUT_TESTING: Duration = Duration::from_seconds_const(30);
73}
74
75pub mod store {
76	use reifydb_value::{byte_size::ByteSize, value::duration::Duration};
77
78	pub const MULTI_POINT_BUFFER_SHARD: ByteSize = ByteSize::from_mib(4);
79	pub const MULTI_POINT_BUFFER_SHARD_TESTING: ByteSize = ByteSize::from_kib(16);
80
81	pub const MULTI_RANGE_BUFFER_SHARD: ByteSize = ByteSize::from_mib(4);
82	pub const MULTI_RANGE_BUFFER_SHARD_TESTING: ByteSize = ByteSize::from_kib(16);
83
84	pub const MULTI_POINT_BUFFER_SHARDS: u16 = 16;
85	pub const MULTI_POINT_BUFFER_SHARDS_TESTING: u16 = 2;
86
87	pub const MULTI_RANGE_BUFFER_SHARDS: u16 = 16;
88	pub const MULTI_RANGE_BUFFER_SHARDS_TESTING: u16 = 2;
89
90	pub const MULTI_FLUSH_INTERVAL: Duration = Duration::from_seconds_const(60);
91	pub const MULTI_FLUSH_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
92
93	pub const COMMIT_MERGE_INTERVAL: Duration = Duration::from_seconds_const(1);
94	pub const COMMIT_MERGE_INTERVAL_TESTING: Duration = Duration::from_seconds_const(1);
95
96	pub const MULTI_FLUSH_BUDGET: ByteSize = ByteSize::from_mib(4);
97	pub const MULTI_FLUSH_BUDGET_TESTING: ByteSize = ByteSize::from_kib(16);
98
99	pub const MULTI_WAL_AUTOCHECKPOINT_PAGES: u64 = 50_000;
100	pub const MULTI_WAL_AUTOCHECKPOINT_PAGES_TESTING: u64 = 64;
101
102	pub const OPERATOR_RANGE_TIER: ByteSize = ByteSize::from_mib(1);
103	pub const OPERATOR_RANGE_TIER_TESTING: ByteSize = ByteSize::from_kib(32);
104
105	pub const OPERATOR_RANGE_RELIEF_INTERVAL: Duration = Duration::from_seconds_const(1);
106
107	pub const OPERATOR_RESIDENT_BUDGET: ByteSize = ByteSize::from_mib(128);
108	pub const OPERATOR_RESIDENT_BUDGET_TESTING: ByteSize = ByteSize::from_kib(64);
109
110	pub const OPERATOR_RESIDENT_ENTRIES: u64 = 1_000_000;
111	pub const OPERATOR_RESIDENT_ENTRIES_TESTING: u64 = 640;
112
113	pub const OPERATOR_RESIDENT_TOMBSTONES: u64 = 128_000;
114	pub const OPERATOR_RESIDENT_TOMBSTONES_TESTING: u64 = 640;
115
116	pub const OPERATOR_DIRTY_BUDGET: ByteSize = ByteSize::from_mib(128);
117	pub const OPERATOR_DIRTY_BUDGET_TESTING: ByteSize = ByteSize::from_kib(64);
118
119	pub const OPERATOR_FLUSH_INTERVAL: Duration = Duration::from_seconds_const(300);
120	pub const OPERATOR_FLUSH_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
121	pub const SYNC_INTERVAL: Duration = Duration::from_seconds_const(1);
122	pub const SYNC_INTERVAL_TESTING: Duration = Duration::from_seconds_const(1);
123
124	pub const OPERATOR_FILTER_KEYS: u64 = 16_000_000;
125	pub const OPERATOR_FILTER_KEYS_TESTING: u64 = 4_096;
126
127	pub const OPERATOR_FLUSH_SLICE: ByteSize = ByteSize::from_mib(4);
128	pub const OPERATOR_FLUSH_SLICE_TESTING: ByteSize = ByteSize::from_kib(16);
129
130	pub const OPERATOR_WAL_AUTOCHECKPOINT_PAGES: u64 = 1_000_000;
131	pub const OPERATOR_WAL_AUTOCHECKPOINT_PAGES_TESTING: u64 = 64;
132}
133
134pub mod flow {
135	use reifydb_value::{byte_size::ByteSize, value::duration::Duration};
136
137	pub const TICK: Duration = Duration::from_seconds_const(1);
138	pub const TICK_TESTING: Duration = Duration::from_seconds_const(1);
139
140	pub const SAMPLE_INTERVAL: Duration = Duration::from_seconds_const(60);
141	pub const SAMPLE_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
142
143	pub const WAKE_COALESCE: Duration = Duration::from_milliseconds_const(20);
144	pub const WAKE_COALESCE_TESTING: Duration = Duration::from_milliseconds_const(20);
145	pub const LINGER: Duration = Duration::from_milliseconds_const(0);
146	pub const LINGER_TESTING: Duration = Duration::from_milliseconds_const(0);
147
148	pub const ACTOR_BATCH_SIZE: u16 = 8;
149	pub const ACTOR_BATCH_SIZE_TESTING: u16 = 8;
150
151	pub const COMMITTER_SHARDS: u16 = 1;
152	pub const COMMITTER_SHARDS_TESTING: u16 = 1;
153
154	pub const BACKLOG_MEMORY_LIMIT: ByteSize = ByteSize::from_mib(64);
155	pub const BACKLOG_MEMORY_LIMIT_TESTING: ByteSize = ByteSize::from_kib(64);
156
157	pub const PULL_BATCH: ByteSize = ByteSize::from_mib(8);
158	pub const PULL_BATCH_TESTING: ByteSize = ByteSize::from_kib(16);
159
160	pub const LOAD_BATCH: ByteSize = ByteSize::from_mib(8);
161	pub const LOAD_BATCH_TESTING: ByteSize = ByteSize::from_kib(16);
162
163	pub const JOIN_PROBE_BLOCK_SIZE: u64 = 1024;
164	pub const JOIN_PROBE_BLOCK_SIZE_TESTING: u64 = 16;
165}
166
167pub mod threads {
168	pub const ASYNC: u16 = 1;
169	pub const ASYNC_TESTING: u16 = 1;
170
171	pub const COORDINATION: u16 = 2;
172	pub const COORDINATION_TESTING: u16 = 1;
173
174	pub const FLOW: u16 = 2;
175	pub const FLOW_TESTING: u16 = 2;
176
177	pub const TASK: u16 = 2;
178	pub const TASK_TESTING: u16 = 1;
179
180	pub const COMPUTE: u16 = 2;
181	pub const COMPUTE_TESTING: u16 = 1;
182
183	pub const MAINTENANCE: u16 = 1;
184	pub const MAINTENANCE_TESTING: u16 = 1;
185
186	pub const SUBSCRIPTION_WORKER: u16 = 0;
187	pub const SUBSCRIPTION_WORKER_TESTING: u16 = 0;
188}
189
190pub mod metrics {
191	use reifydb_value::value::duration::Duration;
192
193	pub const FLUSH_INTERVAL: Duration = Duration::from_seconds_const(10);
194	pub const FLUSH_INTERVAL_TESTING: Duration = Duration::from_seconds_const(10);
195
196	pub const SAMPLE_INTERVAL: Duration = Duration::from_seconds_const(10);
197	pub const SAMPLE_INTERVAL_TESTING: Duration = Duration::from_seconds_const(10);
198
199	pub const SNAPSHOT_INTERVAL: Option<Duration> = None;
200	pub const SNAPSHOT_INTERVAL_TESTING: Option<Duration> = None;
201
202	pub const SMAPS_INTERVAL: Duration = Duration::from_seconds_const(60);
203	pub const SMAPS_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
204}
205
206pub mod queue {
207	use reifydb_value::value::duration::Duration;
208
209	pub const LEASE_REAP_INTERVAL: Duration = Duration::from_seconds_const(5);
210	pub const LEASE_REAP_INTERVAL_TESTING: Duration = Duration::from_seconds_const(5);
211
212	pub const LEASE_REAP_BATCH_SIZE: u64 = 1024;
213	pub const LEASE_REAP_BATCH_SIZE_TESTING: u64 = 16;
214
215	pub const RETENTION_INTERVAL: Duration = Duration::from_seconds_const(60);
216	pub const RETENTION_INTERVAL_TESTING: Duration = Duration::from_seconds_const(60);
217
218	pub const RETENTION_BATCH_SIZE: u64 = 1024;
219	pub const RETENTION_BATCH_SIZE_TESTING: u64 = 16;
220}