1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! LSM level metadata + manifest log.
//!
//! [`VersionSet`] tracks every SSTable across all levels, the
//! current sequence number, and the live WAL number. Each mutation
//! (a flush, a compaction) builds a [`VersionEdit`], appends it to
//! the manifest log, and atomically swaps the current
//! [`Version`] via `Arc`.
//!
//! # Concurrency model
//!
//! - One writer at a time (synchronized externally by `DBImpl`).
//! - Many readers: each `current()` call returns an `Arc<Version>`
//! that survives subsequent edits. Snapshots use this — drop the
//! `Arc` (or `release_version`) when done.
//!
//! # Compaction picker
//!
//! - **Seek-triggered** — a single file consumed too many seeks
//! without yielding values; compact it down a level.
//! ([`Version::take_file_to_compact`])
//! - **Size-triggered** — a level's `files * size / max_bytes` ≥
//! 1.0; compact the file with the largest internal-key range
//! that beats the level's `compact_pointer`.
//!
//! See `pick_compaction` for the priority + picking logic, and
//! `pick_manual_compaction(level, begin, end)` for the bounded
//! variant `DBImpl::compact_range` drives.
//!
//! # Why expose this
//!
//! Internal plumbing under [`crate::db_impl::DBImpl`]. Public for
//! repair tools, inspection scripts, and custom DB shells.
pub use *;
pub use *;
pub use *;