scheduler

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NumTokens is 1 since we only need to insert 1 token to be used for leader election purposes.
	NumTokens = 1
	// ReplicationFactor should be 2 because we want 2 schedulers.
	ReplicationFactor = 2
)

Variables

This section is empty.

Functions

func SafeReadRing

func SafeReadRing(cfg Config, rm *lokiring.RingManager) ring.ReadRing

SafeReadRing does a nil check on the Scheduler before attempting to return it's ring this is necessary as many callers of this function will only have a valid Scheduler reference if the QueryScheduler target has been specified, which is not guaranteed

Types

type Config

type Config struct {
	MaxOutstandingPerTenant int               `yaml:"max_outstanding_requests_per_tenant"`
	MaxQueueHierarchyLevels int               `yaml:"max_queue_hierarchy_levels"`
	QuerierForgetDelay      time.Duration     `yaml:"querier_forget_delay"`
	GRPCClientConfig        grpcclient.Config `yaml:"grpc_client_config" doc:"description=This configures the gRPC client used to report errors back to the query-frontend."`
	// Schedulers ring
	UseSchedulerRing bool                `yaml:"use_scheduler_ring"`
	SchedulerRing    lokiring.RingConfig `` /* 138-byte string literal not displayed */
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

type Limits

type Limits limits.Limits

type Scheduler

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

Scheduler is responsible for queueing and dispatching queries to Queriers.

func NewScheduler

func NewScheduler(cfg Config, schedulerLimits Limits, log log.Logger, ringManager *lokiring.RingManager, registerer prometheus.Registerer, metricsNamespace string) (*Scheduler, error)

NewScheduler creates a new Scheduler.

func (*Scheduler) FrontendLoop

FrontendLoop handles connection from frontend.

func (*Scheduler) QuerierLoop

QuerierLoop is started by querier to receive queries from scheduler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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