indexheader

package
v0.10.0-rc.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// JSONVersion1 is a enumeration of index-cache.json versions supported by Thanos.
	JSONVersion1 = iota + 1
)

Variables

View Source
var NotFoundRange = index.Range{}

NotFoundRange is a range returned by PostingsOffset when there is no posting for given name and value pairs. Has to be default value of index.Range.

Functions

func WriteJSON

func WriteJSON(logger log.Logger, indexFn string, fn string) error

WriteJSON writes a cache file containing the first lookup stages for an index file.

Types

type JSONReader

type JSONReader struct {
	// contains filtered or unexported fields
}

JSONReader is a reader based on index-cache.json files.

func NewJSONReader

func NewJSONReader(ctx context.Context, logger log.Logger, bkt objstore.BucketReader, dir string, id ulid.ULID) (*JSONReader, error)

func (*JSONReader) IndexVersion

func (r *JSONReader) IndexVersion() int

func (*JSONReader) LabelNames

func (r *JSONReader) LabelNames() []string

LabelNames returns a list of label names.

func (*JSONReader) LabelValues

func (r *JSONReader) LabelValues(name string) []string

LabelValues returns label values for single name.

func (*JSONReader) LookupSymbol

func (r *JSONReader) LookupSymbol(o uint32) (string, error)

func (*JSONReader) PostingsOffset

func (r *JSONReader) PostingsOffset(name, value string) index.Range

type Reader

type Reader interface {
	IndexVersion() int
	// TODO(bwplotka): Move to PostingsOffsets(name string, value ...string) []index.Range and benchmark.
	PostingsOffset(name string, value string) index.Range
	LookupSymbol(o uint32) (string, error)
	LabelValues(name string) []string
	LabelNames() []string
}

Reader is an interface allowing to read essential, minimal number of index entries from the small portion of index file called header.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL