planner

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGapsInFingerprintBounds

func FindGapsInFingerprintBounds(ownershipRange v1.FingerprintBounds, metas []v1.FingerprintBounds) (gaps []v1.FingerprintBounds, err error)

func NewQueueMetrics

func NewQueueMetrics(r prometheus.Registerer) *queue.Metrics

func SplitFingerprintKeyspaceByFactor

func SplitFingerprintKeyspaceByFactor(factor int) []v1.FingerprintBounds

SplitFingerprintKeyspaceByFactor splits the keyspace covered by model.Fingerprint into contiguous non-overlapping ranges.

Types

type Config

type Config struct {
	PlanningInterval        time.Duration `yaml:"planning_interval"`
	MinTableOffset          int           `yaml:"min_table_offset"`
	MaxTableOffset          int           `yaml:"max_table_offset"`
	MaxQueuedTasksPerTenant int           `yaml:"max_queued_tasks_per_tenant"`
}

Config configures the bloom-planner component.

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

RegisterFlagsWithPrefix registers flags for the bloom-planner configuration.

func (*Config) Validate

func (cfg *Config) Validate() error

type Limits

type Limits interface {
	BloomCreationEnabled(tenantID string) bool
	BloomSplitSeriesKeyspaceBy(tenantID string) int
	BloomBuildMaxBuilders(tenantID string) int
	BuilderResponseTimeout(tenantID string) time.Duration
	BloomTaskMaxRetries(tenantID string) int
}

type Metrics

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

func NewMetrics

func NewMetrics(
	r prometheus.Registerer,
	getConnectedBuilders func() float64,
) *Metrics

type Planner

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

func New

func New(
	cfg Config,
	limits Limits,
	schemaCfg config.SchemaConfig,
	storeCfg storage.Config,
	storageMetrics storage.ClientMetrics,
	bloomStore bloomshipper.Store,
	logger log.Logger,
	r prometheus.Registerer,
) (*Planner, error)

func (*Planner) BuilderLoop

func (p *Planner) BuilderLoop(builder protos.PlannerForBuilder_BuilderLoopServer) error

type QueueLimits

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

func NewQueueLimits

func NewQueueLimits(limits Limits) *QueueLimits

func (*QueueLimits) MaxConsumers

func (c *QueueLimits) MaxConsumers(tenantID string, allConsumers int) int

MaxConsumers is used to compute how many of the available builders are allowed to handle tasks for a given tenant. 0 is returned when neither limits are applied. 0 means all builders can be used.

type QueueTask

type QueueTask struct {
	*protos.Task
	// contains filtered or unexported fields
}

func NewQueueTask

func NewQueueTask(
	ctx context.Context,
	queueTime time.Time,
	task *protos.Task,
	resultsChannel chan *protos.TaskResult,
) *QueueTask

Jump to

Keyboard shortcuts

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