scanner

package
v1.8.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2021 License: Apache-2.0, Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSeriesToChunkMapping

func GetSeriesToChunkMapping(HashValue string, RangeValue []byte) (user string, index int, seriesID string, chunkID string, err error)

e.RangeValue is: "userID:d<Index>:base64(sha256(labels))". Index is integer, base64 doesn't contain ':'.

func IsMetricLabelToLabelValueMapping

func IsMetricLabelToLabelValueMapping(RangeValue []byte) bool

func IsMetricToSeriesMapping

func IsMetricToSeriesMapping(RangeValue []byte) bool

func IsSeriesToChunkMapping

func IsSeriesToChunkMapping(RangeValue []byte) bool

Series to Chunk mapping uses \0 "3" \0 suffix of range value.

func IsSeriesToLabelValues

func IsSeriesToLabelValues(RangeValue []byte) bool

func UnknownIndexEntryType

func UnknownIndexEntryType(RangeValue []byte) string

Types

type Config

type Config struct {
	TableNames  string
	TablesLimit int

	PeriodStart flagext.DayValue
	PeriodEnd   flagext.DayValue

	OutputDirectory string
	Concurrency     int

	VerifyPlans bool
	UploadFiles bool
	KeepFiles   bool

	AllowedUsers       string
	IgnoredUserPattern string
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

type IndexEntryProcessor

type IndexEntryProcessor interface {
	ProcessIndexEntry(indexEntry chunk.IndexEntry) error

	// Called at the end of reading of index entries.
	Flush() error
}

Processor that receives index entries from the table.

type IndexReader

type IndexReader interface {
	IndexTableNames(ctx context.Context) ([]string, error)

	// Reads a single table from index, and passes individual index entries to the processors.
	//
	// All entries with the same TableName, HashValue and RangeValue are passed to the same processor,
	// and all such entries (with different Values) are passed before index entries with different
	// values of HashValue and RangeValue are passed to the same processor.
	//
	// This allows IndexEntryProcessor to find when values for given Hash and Range finish:
	// as soon as new Hash and Range differ from last IndexEntry.
	//
	// Index entries passed to the same processor arrive sorted by HashValue and RangeValue.
	ReadIndexEntries(ctx context.Context, table string, processors []IndexEntryProcessor) error
}

IndexReader parses index entries and passes them to the IndexEntryProcessor.

type Scanner

type Scanner struct {
	services.Service
	// contains filtered or unexported fields
}

func NewScanner

func NewScanner(cfg Config, scfg blocksconvert.SharedConfig, l log.Logger, reg prometheus.Registerer) (*Scanner, error)

Jump to

Keyboard shortcuts

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