testoldstoreset

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.Registerer,
	storeSpecs func() []StoreSpec,
	dialOpts []grpc.DialOption,
	unhealthyStoreTimeout time.Duration,
) *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) GetStoreStatus

func (s *StoreSet) GetStoreStatus() []StoreStatus

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 updates the fresh metadata from all stores.

type StoreSpec

type StoreSpec interface {
	// Addr returns StoreAPI Address for the store spec. It is used as ID for store.
	Addr() string
	// Metadata returns current labels, store type 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 responsibility to manage
	// given store connection.
	Metadata(ctx context.Context, client storepb.StoreClient) (labelSets []labels.Labels, mint int64, maxt int64, err error)
}

func NewGRPCStoreSpec

func NewGRPCStoreSpec(addr string) StoreSpec

NewGRPCStoreSpec creates store pure gRPC spec. It uses Info gRPC call to get Metadata.

type StoreStatus

type StoreStatus struct {
	Name      string
	LastCheck time.Time
	LastError error
	LabelSets []labels.Labels
	StoreType component.StoreAPI
	MinTime   int64
	MaxTime   int64
}

Jump to

Keyboard shortcuts

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