Documentation ¶
Index ¶
- Variables
- func Overlap(a, b Bounded) bool
- func PostingsForMatchers(ix IndexReader, shard *index.ShardAnnotation, ms ...*labels.Matcher) (index.Postings, error)
- type Bounded
- type ChunkRef
- type Index
- type IndexReader
- type MultiIndex
- func (i *MultiIndex) Bounds() (model.Time, model.Time)
- func (i *MultiIndex) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error)
- func (i *MultiIndex) LabelNames(ctx context.Context, userID string, from, through model.Time, ...) ([]string, error)
- func (i *MultiIndex) LabelValues(ctx context.Context, userID string, from, through model.Time, name string, ...) ([]string, error)
- func (i *MultiIndex) Series(ctx context.Context, userID string, from, through model.Time, res []Series, ...) ([]Series, error)
- type PoolChunkRefs
- type PoolSeries
- type Series
- type TSDBIndex
- func (i *TSDBIndex) Bounds() (model.Time, model.Time)
- func (i *TSDBIndex) GetChunkRefs(_ context.Context, userID string, from, through model.Time, res []ChunkRef, ...) ([]ChunkRef, error)
- func (i *TSDBIndex) LabelNames(_ context.Context, _ string, _, _ model.Time, matchers ...*labels.Matcher) ([]string, error)
- func (i *TSDBIndex) LabelValues(_ context.Context, _ string, _, _ model.Time, name string, ...) ([]string, error)
- func (i *TSDBIndex) Series(_ context.Context, _ string, from, through model.Time, res []Series, ...) ([]Series, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SeriesPool PoolSeries ChunkRefsPool PoolChunkRefs )
Functions ¶
func PostingsForMatchers ¶
func PostingsForMatchers(ix IndexReader, shard *index.ShardAnnotation, ms ...*labels.Matcher) (index.Postings, error)
PostingsForMatchers assembles a single postings iterator against the index reader based on the given matchers. The resulting postings are not ordered by series.
Types ¶
type ChunkRef ¶
type Index ¶
type Index interface { Bounded // GetChunkRefs accepts an optional []ChunkRef argument. // If not nil, it will use that slice to build the result, // allowing us to avoid unnecessary allocations at the caller's discretion. // If nil, the underlying index implementation is required // to build the resulting slice nonetheless (it should not panic), // ideally by requesting a slice from the pool. // Shard is also optional. If not nil, TSDB will limit the result to // the requested shard. If it is nil, TSDB will return all results, // regardless of shard. // Note: any shard used must be a valid factor of two, meaning `0_of_2` and `3_of_4` are fine, but `0_of_3` is not. GetChunkRefs(ctx context.Context, userID string, from, through model.Time, res []ChunkRef, shard *index.ShardAnnotation, matchers ...*labels.Matcher) ([]ChunkRef, error) // Series follows the same semantics regarding the passed slice and shard as GetChunkRefs. Series(ctx context.Context, userID string, from, through model.Time, res []Series, shard *index.ShardAnnotation, matchers ...*labels.Matcher) ([]Series, error) LabelNames(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]string, error) LabelValues(ctx context.Context, userID string, from, through model.Time, name string, matchers ...*labels.Matcher) ([]string, error) }
func NewMultiIndex ¶
type IndexReader ¶
type IndexReader interface { // Bounds returns the earliest and latest samples in the index Bounds() (int64, int64) // Symbols return an iterator over sorted string symbols that may occur in // series' labels and indices. It is not safe to use the returned strings // beyond the lifetime of the index reader. Symbols() index.StringIter // SortedLabelValues returns sorted possible label values. SortedLabelValues(name string, matchers ...*labels.Matcher) ([]string, error) // LabelValues returns possible label values which may not be sorted. LabelValues(name string, matchers ...*labels.Matcher) ([]string, error) // Postings returns the postings list iterator for the label pairs. // The Postings here contain the offsets to the series inside the index. // Found IDs are not strictly required to point to a valid Series, e.g. // during background garbage collections. Input values must be sorted. Postings(name string, shard *index.ShardAnnotation, values ...string) (index.Postings, error) // Series populates the given labels and chunk metas for the series identified // by the reference. // Returns storage.ErrNotFound if the ref does not resolve to a known series. Series(ref storage.SeriesRef, lset *labels.Labels, chks *[]index.ChunkMeta) (uint64, error) // LabelNames returns all the unique label names present in the index in sorted order. LabelNames(matchers ...*labels.Matcher) ([]string, error) // LabelValueFor returns label value for the given label name in the series referred to by ID. // If the series couldn't be found or the series doesn't have the requested label a // storage.ErrNotFound is returned as error. LabelValueFor(id storage.SeriesRef, label string) (string, error) // LabelNamesFor returns all the label names for the series referred to by IDs. // The names returned are sorted. LabelNamesFor(ids ...storage.SeriesRef) ([]string, error) // Close releases the underlying resources of the reader. Close() error }
IndexReader provides reading access of serialized index data.
type MultiIndex ¶
type MultiIndex struct {
// contains filtered or unexported fields
}
func (*MultiIndex) GetChunkRefs ¶
func (*MultiIndex) LabelNames ¶
func (*MultiIndex) LabelValues ¶
type PoolChunkRefs ¶
type PoolChunkRefs struct {
// contains filtered or unexported fields
}
func (*PoolChunkRefs) Get ¶
func (p *PoolChunkRefs) Get() []ChunkRef
func (*PoolChunkRefs) Put ¶
func (p *PoolChunkRefs) Put(xs []ChunkRef)
type PoolSeries ¶
type PoolSeries struct {
// contains filtered or unexported fields
}
func (*PoolSeries) Get ¶
func (p *PoolSeries) Get() []Series
func (*PoolSeries) Put ¶
func (p *PoolSeries) Put(xs []Series)
type TSDBIndex ¶
type TSDBIndex struct {
// contains filtered or unexported fields
}
nolint
func NewTSDBIndex ¶
func NewTSDBIndex(reader IndexReader) *TSDBIndex
func (*TSDBIndex) GetChunkRefs ¶
func (*TSDBIndex) LabelNames ¶
func (*TSDBIndex) LabelValues ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.