storage

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2020 License: Apache-2.0 Imports: 25 Imported by: 51

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivePeriodConfig added in v1.6.0

func ActivePeriodConfig(cfg SchemaConfig) int

ActivePeriodConfig returns index of active PeriodicConfig which would be applicable to logs that would be pushed starting now. Note: Another PeriodicConfig might be applicable for future logs which can change index type.

func IsBlockOverlapping added in v1.6.0

func IsBlockOverlapping(b chunkenc.Block, with *LazyChunk, direction logproto.Direction) bool

func NewTableClient added in v1.6.0

func NewTableClient(name string, cfg Config) (chunk.TableClient, error)

NewTableClient creates a TableClient for managing tables for index/chunk store. ToDo: Add support in Cortex for registering custom table client like index client.

func RegisterCustomIndexClients added in v1.5.0

func RegisterCustomIndexClients(cfg *Config, registerer prometheus.Registerer)

func UsingBoltdbShipper added in v1.6.0

func UsingBoltdbShipper(cfg SchemaConfig) bool

UsingBoltdbShipper checks whether current or the next index type is boltdb-shipper, returns true if yes.

Types

type Config

type Config struct {
	storage.Config      `yaml:",inline"`
	MaxChunkBatchSize   int            `yaml:"max_chunk_batch_size"`
	BoltDBShipperConfig shipper.Config `yaml:"boltdb_shipper"`
}

Config is the loki storage configuration

func (*Config) RegisterFlags

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

RegisterFlags adds the flags required to configure this flag set.

type LazyChunk added in v1.6.0

type LazyChunk struct {
	Chunk   chunk.Chunk
	IsValid bool
	Fetcher *chunk.Fetcher
	// contains filtered or unexported fields
}

LazyChunk loads the chunk when it is accessed.

func (*LazyChunk) IsOverlapping added in v1.6.0

func (c *LazyChunk) IsOverlapping(with *LazyChunk, direction logproto.Direction) bool

func (*LazyChunk) Iterator added in v1.6.0

func (c *LazyChunk) Iterator(
	ctx context.Context,
	from, through time.Time,
	direction logproto.Direction,
	filter logql.LineFilter,
	nextChunk *LazyChunk,
) (iter.EntryIterator, error)

Iterator returns an entry iterator. The iterator returned will cache overlapping block's entries with the next chunk if passed. This way when we re-use them for ordering across batches we don't re-decompress the data again.

func (*LazyChunk) SampleIterator added in v1.6.0

func (c *LazyChunk) SampleIterator(
	ctx context.Context,
	from, through time.Time,
	filter logql.LineFilter,
	extractor logql.SampleExtractor,
	nextChunk *LazyChunk,
) (iter.SampleIterator, error)

SampleIterator returns an sample iterator. The iterator returned will cache overlapping block's entries with the next chunk if passed. This way when we re-use them for ordering across batches we don't re-decompress the data again.

type SchemaConfig added in v1.6.0

type SchemaConfig struct {
	chunk.SchemaConfig `yaml:",inline"`
}

SchemaConfig contains the config for our chunk index schemas

func (*SchemaConfig) Validate added in v1.6.0

func (cfg *SchemaConfig) Validate() error

Validate the schema config and returns an error if the validation doesn't pass

type Store

Store is the Loki chunk store to retrieve and save chunks.

func NewStore

func NewStore(cfg Config, storeCfg chunk.StoreConfig, schemaCfg SchemaConfig, limits storage.StoreLimits, registerer prometheus.Registerer) (Store, error)

NewStore creates a new Loki Store using configuration supplied.

Directories

Path Synopsis
stores

Jump to

Keyboard shortcuts

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