shard

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ShardLabel is a reserved label referencing a cortex shard
	ShardLabel = "__cortex_shard__"
	// ShardLabelFmt is the fmt of the ShardLabel key.
	ShardLabelFmt = "%d_of_%d"
)

Variables

View Source
var ShardLabelRE = regexp.MustCompile("^[0-9]+_of_[0-9]+$")

ShardLabelRE matches a value in ShardLabelFmt

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Shard int
	Of    int
}

Annotation is a convenience struct which holds data from a parsed shard label

func FromMatchers

func FromMatchers(matchers []*labels.Matcher) (shard *Annotation, idx int, err error)

FromMatchers extracts a ShardAnnotation and the index it was pulled from in the matcher list

func ParseShard

func ParseShard(input string) (parsed Annotation, err error)

ParseShard will extract the shard information encoded in ShardLabelFmt

func (Annotation) Label

func (shard Annotation) Label() labels.Label

Label generates the ShardAnnotation as a label

func (Annotation) Match

func (shard Annotation) Match(fp model.Fingerprint) bool

func (Annotation) String

func (shard Annotation) String() string

String encodes a shardAnnotation into a label value

func (Annotation) TSDB

func (shard Annotation) TSDB() index.ShardAnnotation

Jump to

Keyboard shortcuts

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