Skip to main content

pick_inactive_l0

Function pick_inactive_l0 

Source
fn pick_inactive_l0(
    l0_files: Vec<FileHandle>,
    l1_files: Option<&[FileHandle]>,
    max_output_file_size: Option<u64>,
    mapper: &PrimaryKeyRangeMapper,
) -> Option<(Vec<FileHandle>, usize, &'static str)>
Expand description

Absorbs L0 files of an inactive window, in order of preference:

  1. Balanced merges of L0 files, which leave L1 files untouched.
  2. Mixed merges that bypass the balance checks, but only when the total rewrite fits in the output file budget, bounding write amplification. Skipped without l1_files.
  3. Merges of L0 files among themselves regardless of balance. The rewrite is bounded by the L0 bytes and leaves large compacted files untouched.

Every pick consumes L0 files.