Skip to main content

pick_active_l1

Function pick_active_l1 

Source
pub(crate) fn pick_active_l1(
    l1_files: &[FileHandle],
    mapper: &PrimaryKeyRangeMapper,
    options: PickLimits,
) -> Option<UnitPick>
Expand description

Picks L1 files of the active window whose compaction removes files.

Units are groups of conflicting files, so a merge does not leave a file behind while rewriting its overlapping peers. A group larger than the input limit is split back into single files. If no interval of groups qualifies, for example because a large file dominates its group, the groups are split into single files, so the smaller files can still be merged. Intervals follow sort_units; the pick removes the most files, then rewrites the fewest bytes.