Structsยง
- Candidate ๐
- Metrics of a candidate compaction input, accumulated incrementally as the candidate interval expands one file at a time.
- Candidate
Score ๐ - Score of a candidate compaction input. Higher is better: first by the predicted net file count reduction, then by the number of files participating in an overlap, then by smaller input bytes.
- Inactive
Window ๐Pick - Picks compaction inputs for an inactive window.
- Ordered
File ๐ - Twcs
Picker TwcsPickerpicks files of which the max timestamp are in the same time window as compaction candidates.- Window ๐
- Window
Output ๐Context - Window
Pick ๐Context
Enumsยง
- Pick
Phase ๐
Constantsยง
- DEFAULT_
MAX_ ๐INPUT_ FILES - Default maximum number of input SST files in one compaction input.
- LEVEL_
COMPACTED ๐ - MAX_
INPUT_ ๐FILES_ ENV - MAX_
L1_ ๐L0_ ROW_ RATIO - A mixed L0/L1 compaction may rewrite at most this many L1 rows per L0 row.
- PICK_
PHASES ๐
Staticsยง
- MAX_
INPUT_ ๐FILES - Maximum number of input SST files in one compaction input.
Configurable via
MAX_INPUT_FILES_ENV.
Functionsยง
- assign_
to_ ๐windows - Assigns files to windows with predefined window size (in seconds) by their max timestamps.
- find_
active_ ๐window_ by_ sequence - Finds the active window from the file with the highest sequence number.
- find_
latest_ ๐window_ in_ seconds - Finds the latest active writing window among all files.
Returns
Nonewhen there are no files or all files are corrupted. - is_
balanced_ ๐candidate - log_
pick_ ๐result - ordered_
files ๐ - Flattens sorted runs into files ordered by
(start asc, end desc), breaking ties by run and position to keep the order deterministic. - parse_
max_ ๐input_ files - pick_
candidate_ ๐files - pick_
count_ ๐first - Picks a contiguous (in global time order) interval of files to compact.
- pick_
count_ ๐first_ where - pick_
inactive_ ๐window_ files - pick_
l1_ ๐candidate_ files - pick_
l1_ ๐file_ reduction - pick_
l1_ ๐overlap_ only - pick_
mixed_ ๐within_ budget - Mixed-level fallback for inactive windows: bypasses the balance checks but bounds the total rewrite to the output file budget.
- pick_
unbalanced_ ๐count_ first - Last-resort pick for inactive windows with no balance requirement at all. Callers must only pass single-level (L0) files so the rewrite stays bounded by their bytes.
- selected_
overlaps_ ๐unselected - time_
window_ ๐intersects_ range - window_
has_ ๐overlap
Type Aliasesยง
- Candidate
Picker ๐