Module twcs

Source

StructsΒ§

TwcsPicker
TwcsPicker picks files of which the max timestamp are in the same time window as compaction candidates.
Window πŸ”’

ConstantsΒ§

LEVEL_COMPACTED πŸ”’

FunctionsΒ§

assign_to_windows πŸ”’
Assigns files to windows with predefined window size (in seconds) by their max timestamps.
enforce_file_num πŸ”’
Merges consecutive files so that file num does not exceed max_file_num, and chooses the solution with minimum overhead according to files sizes to be merged. enforce_file_num only merges consecutive files so that it won’t create overlapping outputs. runs must be sorted according to time ranges.
enforce_max_output_size πŸ”’
Limits the size of compaction output in a naive manner. todo(hl): we can find the output file size more precisely by checking the time range of each row group and adding the sizes of those non-overlapping row groups. But now we’d better not to expose the SST details in this level.
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.