Expand description
Prometheus TSDB index reader (format v1/v2/v3).
Two access patterns share this reader. A sequential export walks the series
section in lexicographic label order, which is also the physical order of
their chunks in the segment files; IndexReader::series does that without
touching any label index. A lookup-driven consumer asks for one label pair
instead; IndexReader::postings serves that from a sampled view of the
postings offset table, so no full label index is ever held in memory.
Module layout:
| Module | Responsibility |
|---|---|
toc | table of contents: section offsets, bounds and ordering |
symbols | symbol table (v1 inline refs, v2/v3 offset groups) |
series | series records, chunk metadata, sequential iterator |
postings | postings lists, label names/values, sorted unions |
postings_ops | intersection, union and difference over postings |
label_index | the LabelIndexReader trait over the label space |
matcher | label matchers and the postings plan they compile to |
validation | section boundary and layout checks |
Re-exports§
pub use label_index::LabelIndexReader;pub use matcher::LabelMatcher;pub use matcher::MatchType;pub use postings::MergedPostings;pub use postings::Postings;pub use postings::PostingsList;pub use postings::PostingsStats;pub use postings::VecPostings;pub use postings_ops::difference;pub use postings_ops::intersect;pub use postings_ops::intersect_all;pub use postings_ops::union_all;pub use postings_ops::BoxPostings;pub use postings_ops::Difference;pub use postings_ops::Intersection;pub use postings_ops::Union;
Modules§
- label_
index - Label lookups behind a trait, so a query layer can treat any label space uniformly.
- matcher
- Label matchers and the postings plan they compile to.
- postings
- Postings lists and label lookups (index v1, v2 and v3).
- postings_
ops - Set operations over postings: intersection, union and difference.
- validation
- Structural validation of the index TOC and section boundaries.
Structs§
- Chunk
Meta - Where one chunk lives and which time range it covers.
- Index
Reader - Reader for the index of one block.
- Index
Stats - Series and chunk counts, plus the byte range they were read from.
- Series
Iter - Iterator over the series section, in on-disk (label-sorted) order.
- Series
Ref - One series: its label set and the chunks that hold its samples.
- Toc
- The index table of contents: absolute file offsets of every section.