Versions in this module Expand all Collapse all v2 v2.5.2 Apr 27, 2022 Changes in this version + const FormatV1 + const FormatV2 + const HeaderLen + const IndexFilename + const MagicIndex + const ShardLabel + const ShardLabelFmt + func AllPostingsKey() (name, value string) + func ExpandPostings(p Postings) (res []storage.SeriesRef, err error) + func ReadOffsetTable(bs ByteSlice, off uint64, f func([]string, uint64, int) error) error + type Builder struct + func NewBuilder() *Builder + func (b *Builder) AddSeries(ls labels.Labels, chks []ChunkMeta) + func (b *Builder) Build(ctx context.Context, dir, tenant string) (id Identifier, err error) + type ByteSlice interface + Len func() int + Range func(start, end int) []byte + type ChunkMeta struct + Checksum uint32 + Entries uint32 + KB uint32 + MaxTime int64 + MinTime int64 + func (c ChunkMeta) Bounds() (model.Time, model.Time) + func (c ChunkMeta) From() model.Time + func (c ChunkMeta) Through() model.Time + type ChunkMetas []ChunkMeta + func (c ChunkMetas) Bounds() (mint, maxt model.Time) + func (c ChunkMetas) Len() int + func (c ChunkMetas) Less(i, j int) bool + func (c ChunkMetas) Swap(i, j int) + type Decoder struct + LookupSymbol func(uint32) (string, error) + func (dec *Decoder) LabelNamesOffsetsFor(b []byte) ([]uint32, error) + func (dec *Decoder) LabelValueFor(b []byte, label string) (string, error) + func (dec *Decoder) Postings(b []byte) (int, Postings, error) + func (dec *Decoder) Series(b []byte, lbls *labels.Labels, chks *[]ChunkMeta) (uint64, error) + type FileWriter struct + func NewFileWriter(name string) (*FileWriter, error) + func (fw *FileWriter) AddPadding(size int) error + func (fw *FileWriter) Close() error + func (fw *FileWriter) Flush() error + func (fw *FileWriter) Pos() uint64 + func (fw *FileWriter) Remove() error + func (fw *FileWriter) Write(bufs ...[]byte) error + func (fw *FileWriter) WriteAt(buf []byte, pos uint64) error + type FingerprintOffsets [][2]uint64 + func (xs FingerprintOffsets) Range(shard ShardAnnotation) (minOffset, maxOffset uint64) + type Identifier struct + Checksum uint32 + From model.Time + Tenant string + Through model.Time + func (i Identifier) FilePath(parentDir string) string + func (i Identifier) String() string + type ListPostings struct + func (it *ListPostings) At() storage.SeriesRef + func (it *ListPostings) Err() error + func (it *ListPostings) Next() bool + func (it *ListPostings) Seek(x storage.SeriesRef) bool + type MemPostings struct + func NewMemPostings() *MemPostings + func NewUnorderedMemPostings() *MemPostings + func (p *MemPostings) Add(id storage.SeriesRef, lset labels.Labels) + func (p *MemPostings) All() Postings + func (p *MemPostings) Delete(deleted map[storage.SeriesRef]struct{}) + func (p *MemPostings) EnsureOrder() + func (p *MemPostings) Get(name, value string) Postings + func (p *MemPostings) Iter(f func(labels.Label, Postings) error) error + func (p *MemPostings) LabelNames() []string + func (p *MemPostings) LabelValues(name string) []string + func (p *MemPostings) SortedKeys() []labels.Label + func (p *MemPostings) Stats(label string) *PostingsStats + func (p *MemPostings) Symbols() StringIter + type Metadata struct + Checksum uint32 + From int64 + Through int64 + func (m *Metadata) EnsureBounds(from, through int64) + type PoolChunkMetas struct + var ChunkMetasPool PoolChunkMetas + func (p *PoolChunkMetas) Get() []ChunkMeta + func (p *PoolChunkMetas) Put(xs []ChunkMeta) + type Postings interface + At func() storage.SeriesRef + Err func() error + Next func() bool + Seek func(v storage.SeriesRef) bool + func EmptyPostings() Postings + func ErrPostings(err error) Postings + func Intersect(its ...Postings) Postings + func Merge(its ...Postings) Postings + func NewListPostings(list []storage.SeriesRef) Postings + func Without(full, drop Postings) Postings + type PostingsStats struct + CardinalityLabelStats []Stat + CardinalityMetricsStats []Stat + LabelValuePairsStats []Stat + LabelValueStats []Stat + NumLabelPairs int + type Range struct + End int64 + Start int64 + type Reader struct + func NewFileReader(path string) (*Reader, error) + func NewReader(b ByteSlice) (*Reader, error) + func (r *Reader) Bounds() (int64, int64) + func (r *Reader) Checksum() uint32 + func (r *Reader) Close() error + func (r *Reader) LabelNames(matchers ...*labels.Matcher) ([]string, error) + func (r *Reader) LabelNamesFor(ids ...storage.SeriesRef) ([]string, error) + func (r *Reader) LabelValueFor(id storage.SeriesRef, label string) (string, error) + func (r *Reader) LabelValues(name string, matchers ...*labels.Matcher) ([]string, error) + func (r *Reader) Postings(name string, shard *ShardAnnotation, values ...string) (Postings, error) + func (r *Reader) PostingsRanges() (map[labels.Label]Range, error) + func (r *Reader) Series(id storage.SeriesRef, lbls *labels.Labels, chks *[]ChunkMeta) (uint64, error) + func (r *Reader) Size() int64 + func (r *Reader) SortedLabelValues(name string, matchers ...*labels.Matcher) ([]string, error) + func (r *Reader) SymbolTableSize() uint64 + func (r *Reader) Symbols() StringIter + func (r *Reader) Version() int + type ShardAnnotation struct + Of uint32 + Shard uint32 + func NewShard(x, of uint32) ShardAnnotation + func (shard ShardAnnotation) Bounds() (model.Fingerprint, model.Fingerprint) + func (shard ShardAnnotation) Match(fp model.Fingerprint) bool + func (shard ShardAnnotation) RequiredBits() uint64 + func (shard ShardAnnotation) String() string + type ShardedPostings struct + func NewShardedPostings(p Postings, shard ShardAnnotation, offsets FingerprintOffsets) *ShardedPostings + func (sp *ShardedPostings) At() storage.SeriesRef + func (sp *ShardedPostings) Err() (err error) + func (sp *ShardedPostings) Next() bool + func (sp *ShardedPostings) Seek(v storage.SeriesRef) (res bool) + type Stat struct + Count uint64 + Name string + type StringIter interface + At func() string + Err func() error + Next func() bool + func NewStringListIter(s []string) StringIter + type Symbols struct + func NewSymbols(bs ByteSlice, version, off int) (*Symbols, error) + func (s Symbols) Iter() StringIter + func (s Symbols) Lookup(o uint32) (string, error) + func (s Symbols) ReverseLookup(sym string) (uint32, error) + func (s Symbols) Size() int + type TOC struct + FingerprintOffsets uint64 + LabelIndices uint64 + LabelIndicesTable uint64 + Metadata Metadata + Postings uint64 + PostingsTable uint64 + Series uint64 + Symbols uint64 + func NewTOCFromByteSlice(bs ByteSlice) (*TOC, error) + type Writer struct + Version int + func NewWriter(ctx context.Context, fn string) (*Writer, error) + func (w *Writer) AddSeries(ref storage.SeriesRef, lset labels.Labels, chunks ...ChunkMeta) error + func (w *Writer) AddSymbol(sym string) error + func (w *Writer) Close() error