query

package
v0.1.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2018 License: Apache-2.0 Imports: 22 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PartialErrReporter

type PartialErrReporter func(error)

PartialErrReporter allows to report partial errors. Partial error occurs when only part of the results are ready and another is not available because of the failure. We still want to return partial result, but with some notification. NOTE: It is required to be thread-safe.

type QueryableCreator

type QueryableCreator func(deduplicate bool, p PartialErrReporter) storage.Queryable

QueryableCreator returns implementation of promql.Queryable that fetches data from the proxy store API endpoints. If deduplication is enabled, all data retrieved from it will be deduplicated along the replicaLabel by default.

func NewQueryableCreator

func NewQueryableCreator(logger log.Logger, proxy storepb.StoreServer, replicaLabel string) QueryableCreator

NewQueryableCreator creates QueryableCreator.

type StoreSet

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

StoreSet maintains a set of active stores. It is backed up by Store Specifications that are dynamically fetched on every Update() call.

func NewStoreSet

func NewStoreSet(
	logger log.Logger,
	reg *prometheus.Registry,
	storeSpecs func() []StoreSpec,
	dialOpts []grpc.DialOption,
) *StoreSet

NewStoreSet returns a new set of stores from cluster peers and statically configured ones.

func (*StoreSet) Close

func (s *StoreSet) Close()

func (*StoreSet) Get

func (s *StoreSet) Get() []store.Client

Get returns a list of all active stores.

func (*StoreSet) Update

func (s *StoreSet) Update(ctx context.Context)

Update updates the store set. It fetches current list of store specs from function and grabs fresh metadata.

type StoreSpec

type StoreSpec interface {
	// Address for the store spec. It is used as ID for store.
	Addr() string
	// Metadata returns current labels and min, max ranges for store.
	// It can change for every call for this method.
	// If metadata call fails we assume that store is no longer accessible and we should not use it.
	// NOTE: It is implementation responsibility to retry until context timeout, but a caller responsibilty to manage
	// given store connection.
	Metadata(ctx context.Context, client storepb.StoreClient) (labels []storepb.Label, mint int64, maxt int64, err error)
}

func NewStaticStoreSpec

func NewStaticStoreSpec(addr string) StoreSpec

NewStaticStoreSpec creates store spec for static store. This is used only for query command but we include this here to properly test this spec inside storeset_test.go

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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