Skip to main content

Module picker

Module picker 

Source
Expand description

Compaction picker — decides which segments to compact.

Implements a hybrid compaction strategy combining:

  • TWCS (Time-Window Compaction Strategy) — groups segments by time shard and triggers compaction when L0 count exceeds a threshold.
  • Size-tiered merging — within each time window, groups segments by size tier and merges segments in the same tier when their count reaches a configurable threshold.

Both strategies respect shard boundaries (never compact across shards) and support multi-level tiering (L0→L1→L2).

A write-amplification budget tracks cumulative bytes rewritten per compaction cycle. Low-priority merges are deferred when the budget is exhausted, preventing runaway background I/O.

Compaction policies are configurable per namespace via CompactionPolicy.

Structs§

CompactionPicker
Hybrid compaction picker combining TWCS and size-tiered strategies.
CompactionPolicy
Per-namespace compaction policy configuration.
CompactionTask
A compaction task describing which segments to merge.
WriteAmpTracker
Tracks cumulative bytes rewritten per compaction cycle for write-amplification budgeting.

Enums§

CompactionLevel
Compaction level for segment tiering.
CompactionStrategy
Compaction strategy selection.
SegmentState
Lifecycle state for a segment file.
SizeTier
Size tier for grouping segments by byte size.