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§
- Compaction
Picker - Hybrid compaction picker combining TWCS and size-tiered strategies.
- Compaction
Policy - Per-namespace compaction policy configuration.
- Compaction
Task - A compaction task describing which segments to merge.
- Write
AmpTracker - Tracks cumulative bytes rewritten per compaction cycle for write-amplification budgeting.
Enums§
- Compaction
Level - Compaction level for segment tiering.
- Compaction
Strategy - Compaction strategy selection.
- Segment
State - Lifecycle state for a segment file.
- Size
Tier - Size tier for grouping segments by byte size.