linkrs_query/executor/streaming/spill/config.rs
1use std::path::PathBuf;
2
3/// Configuration for disk spill behavior.
4#[derive(Debug, Clone)]
5pub struct SpillConfig {
6 /// Directory for spill files. `None` → system temp dir.
7 pub temp_dir: Option<PathBuf>,
8 /// Maximum number of spill files per operator instance.
9 pub max_spill_files: usize,
10 /// Terminal collector spill threshold in logical rows.
11 /// `None` → default threshold; `Some(0)` → collector never spills.
12 pub collect_spill_rows: Option<u64>,
13}
14
15impl Default for SpillConfig {
16 fn default() -> Self {
17 Self {
18 temp_dir: None,
19 max_spill_files: 64,
20 collect_spill_rows: None,
21 }
22 }
23}
24
25/// Default terminal-collector spill threshold in logical rows.
26pub const COLLECTOR_SPILL_ROWS_DEFAULT: u64 = 200_000;
27
28/// Maximum rows per terminal-collector run file. Bounds both the writer-side
29/// body buffer and the reader-side full-run load peak.
30pub const COLLECTOR_RUN_ROWS_MAX: u64 = 65_536;
31
32/// Default Grace Hash Join partition count.
33pub const HASH_JOIN_PARTITIONS_DEFAULT: u64 = 32;
34
35/// Maximum Grace Hash Join repartition depth.
36pub const HASH_JOIN_MAX_DEPTH: u32 = 3;