scheduler

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: AGPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidiStreamCloser

type BidiStreamCloser[Req, Res any] struct {
	// contains filtered or unexported fields
}

BidiStreamCloser is a wrapper around BidiStream that allows to close it. Once closed, it will return io.EOF on Receive and Send.

func (*BidiStreamCloser[Req, Res]) Close

func (c *BidiStreamCloser[Req, Res]) Close()

func (*BidiStreamCloser[Req, Res]) Receive

func (c *BidiStreamCloser[Req, Res]) Receive() (*Req, error)

func (*BidiStreamCloser[Req, Res]) Send

func (b *BidiStreamCloser[Req, Res]) Send(msg *Res) error

type Config

type Config struct {
	MaxOutstandingPerTenant int                       `yaml:"max_outstanding_requests_per_tenant"`
	QuerierForgetDelay      time.Duration             `yaml:"querier_forget_delay" category:"experimental"`
	GRPCClientConfig        grpcclient.Config         `yaml:"grpc_client_config" doc:"description=This configures the gRPC client used to report errors back to the query-frontend."`
	ServiceDiscovery        schedulerdiscovery.Config `yaml:",inline"`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet, logger log.Logger)

func (*Config) Validate

func (cfg *Config) Validate() error

type Limits

type Limits interface {
	// MaxQueriersPerTenant returns max queriers to use per tenant, or 0 if shuffle sharding is disabled.
	MaxQueriersPerTenant(tenant string) int
}

Limits needed for the Query Scheduler - interface used for decoupling.

type Scheduler

Scheduler is responsible for queueing and dispatching queries to Queriers.

func NewScheduler

func NewScheduler(cfg Config, limits Limits, log log.Logger, registerer prometheus.Registerer) (*Scheduler, error)

NewScheduler creates a new Scheduler.

func (*Scheduler) FrontendLoop

func (s *Scheduler) FrontendLoop(ctx context.Context, frontend *connect.BidiStream[schedulerpb.FrontendToScheduler, schedulerpb.SchedulerToFrontend]) error

FrontendLoop handles connection from frontend.

func (*Scheduler) NotifyQuerierShutdown

func (s *Scheduler) NotifyQuerierShutdown(ctx context.Context, req *connect.Request[schedulerpb.NotifyQuerierShutdownRequest]) (*connect.Response[schedulerpb.NotifyQuerierShutdownResponse], error)

func (*Scheduler) QuerierLoop

func (s *Scheduler) QuerierLoop(ctx context.Context, bidi *connect.BidiStream[schedulerpb.QuerierToScheduler, schedulerpb.SchedulerToQuerier]) error

QuerierLoop is started by querier to receive queries from scheduler.

func (*Scheduler) RingHandler

func (s *Scheduler) RingHandler(w http.ResponseWriter, req *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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