planner

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: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PlanningInterval time.Duration   `yaml:"planning_interval"`
	MinTableOffset   int             `yaml:"min_table_offset"`
	MaxTableOffset   int             `yaml:"max_table_offset"`
	RetentionConfig  RetentionConfig `yaml:"retention"`
	Queue            queue.Config    `yaml:"queue"`
}

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 {
	RetentionLimits
	strategies.Limits
	BloomCreationEnabled(tenantID string) bool
	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.StoreBase,
	logger log.Logger,
	r prometheus.Registerer,
	rm *ring.RingManager,
) (*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.ProtoTask
	*TaskMeta
}

func NewQueueTask

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

type RetentionConfig added in v3.2.0

type RetentionConfig struct {
	Enabled         bool `yaml:"enabled"`
	MaxLookbackDays int  `yaml:"max_lookback_days" doc:"hidden"`
}

func (*RetentionConfig) RegisterFlagsWithPrefix added in v3.2.0

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

func (*RetentionConfig) Validate added in v3.2.0

func (cfg *RetentionConfig) Validate() error

type RetentionLimits added in v3.2.0

type RetentionLimits interface {
	RetentionPeriod(userID string) time.Duration
	StreamRetention(userID string) []validation.StreamRetention
	AllByUserID() map[string]*validation.Limits
	DefaultLimits() *validation.Limits
}

type RetentionManager added in v3.2.0

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

func NewRetentionManager added in v3.2.0

func NewRetentionManager(
	cfg RetentionConfig,
	limits RetentionLimits,
	bloomStore bloomshipper.StoreBase,
	metrics *Metrics,
	logger log.Logger,
) *RetentionManager

func (*RetentionManager) Apply added in v3.2.0

func (r *RetentionManager) Apply(ctx context.Context) error

type TaskMeta added in v3.3.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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