Skip to main content

Module twcs

Module twcs 

Source

Structsยง

Candidate ๐Ÿ”’
Metrics of a candidate compaction input, accumulated incrementally as the candidate interval expands one file at a time.
CandidateScore ๐Ÿ”’
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.
OrderedFile ๐Ÿ”’
TwcsPicker
TwcsPicker picks files of which the max timestamp are in the same time window as compaction candidates.
Window ๐Ÿ”’

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.

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_latest_window_in_seconds ๐Ÿ”’
Finds the latest active writing window among all files. Returns None when there are no files or all files are corrupted.
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_mixed_count_first ๐Ÿ”’
selected_overlaps_unselected ๐Ÿ”’
time_window_intersects_range ๐Ÿ”’
window_has_overlap ๐Ÿ”’