common

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RingKeyOfLeader = 0xffff
)

Variables

This section is empty.

Functions

func NewTSDBSeriesIter

func NewTSDBSeriesIter(ctx context.Context, user string, f sharding.ForSeries, bounds v1.FingerprintBounds) (iter.Iterator[*v1.Series], error)

Types

type BloomTSDBStore

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

BloomTSDBStore is a wrapper around the storage.Client interface which implements the TSDBStore interface for this pkg.

func NewBloomTSDBStore

func NewBloomTSDBStore(storage storage.Client, logger log.Logger) *BloomTSDBStore

func (*BloomTSDBStore) LoadTSDB

func (b *BloomTSDBStore) LoadTSDB(
	ctx context.Context,
	table config.DayTable,
	tenant string,
	id tsdb.Identifier,
) (ClosableForSeries, error)

func (*BloomTSDBStore) ResolveTSDBs

func (b *BloomTSDBStore) ResolveTSDBs(ctx context.Context, table config.DayTable, tenant string) ([]tsdb.SingleTenantTSDBIdentifier, error)

func (*BloomTSDBStore) UsersForPeriod

func (b *BloomTSDBStore) UsersForPeriod(ctx context.Context, table config.DayTable) ([]string, error)

type ClosableForSeries added in v3.2.0

type ClosableForSeries interface {
	sharding.ForSeries
	Close() error
}

type RingWatcher added in v3.2.0

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

func NewRingWatcher added in v3.2.0

func NewRingWatcher(id string, ring *ring.Ring, lookupPeriod time.Duration, logger log.Logger) *RingWatcher

NewRingWatcher creates a service.Service that watches a ring for a leader instance. The leader instance is the instance that owns the key `RingKeyOfLeader`. It provides functions to get the leader's address, and to check whether a given instance in the ring is leader. Bloom planner and bloom builder use this ring watcher to hook into index gateway ring when they are run as part of the `backend` target of the Simple Scalable Deployment (SSD). It should not be used for any other components outside of the bloombuild package.

func (*RingWatcher) GetLeaderAddress added in v3.2.0

func (w *RingWatcher) GetLeaderAddress() (string, error)

func (*RingWatcher) IsInstanceLeader added in v3.2.0

func (w *RingWatcher) IsInstanceLeader(instanceID string) bool

func (*RingWatcher) IsLeader added in v3.2.0

func (w *RingWatcher) IsLeader() bool

type TSDBStore

type TSDBStore interface {
	UsersForPeriod(ctx context.Context, table config.DayTable) ([]string, error)
	ResolveTSDBs(ctx context.Context, table config.DayTable, tenant string) ([]tsdb.SingleTenantTSDBIdentifier, error)
	LoadTSDB(
		ctx context.Context,
		table config.DayTable,
		tenant string,
		id tsdb.Identifier,
	) (ClosableForSeries, error)
}

type TSDBStores

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

func NewTSDBStores

func NewTSDBStores(
	component string,
	schemaCfg config.SchemaConfig,
	storeCfg baseStore.Config,
	clientMetrics baseStore.ClientMetrics,
	logger log.Logger,
) (*TSDBStores, error)

func (*TSDBStores) LoadTSDB

func (s *TSDBStores) LoadTSDB(
	ctx context.Context,
	table config.DayTable,
	tenant string,
	id tsdb.Identifier,
) (ClosableForSeries, error)

func (*TSDBStores) ResolveTSDBs

func (s *TSDBStores) ResolveTSDBs(ctx context.Context, table config.DayTable, tenant string) ([]tsdb.SingleTenantTSDBIdentifier, error)

func (*TSDBStores) UsersForPeriod

func (s *TSDBStores) UsersForPeriod(ctx context.Context, table config.DayTable) ([]string, error)

Jump to

Keyboard shortcuts

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