scheduler

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

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

func NewScheduler

func NewScheduler(ctx context.Context) *Scheduler

NewScheduler returns a new instance of scheduler

func (*Scheduler) AddExtender

func (s *Scheduler) AddExtender(ext extenders.Extender) error

AddExtender adds a new extender to the slice of the extenders that are used to determine modules' states

func (*Scheduler) AddModuleVertex

func (s *Scheduler) AddModuleVertex(module node.ModuleInterface) error

AddModuleVertex adds a new vertex of type Module to the graph

func (*Scheduler) AddWeightVertex

func (s *Scheduler) AddWeightVertex(vertex *node.Node) error

AddWeightVertex adds a new vertex of type Weight to the graph

func (*Scheduler) ApplyExtenders

func (s *Scheduler) ApplyExtenders(extendersEnv string) error

ApplyExtenders excludes and reorders attached extenders according to the APPLIED_MODULE_EXTENDERS env variable

func (*Scheduler) EventCh

func (s *Scheduler) EventCh() chan extenders.ExtenderEvent

func (*Scheduler) Filter

func (s *Scheduler) Filter(extName extenders.ExtenderName, moduleName string, logLabels map[string]string) (*bool, error)

Filter returns filtering result for the specified extender and module

func (*Scheduler) GetEnabledModuleNames

func (s *Scheduler) GetEnabledModuleNames() []string

GetEnabledModuleNames returns a list of all enabled module-type vertices from s.enabledModules so that traversing the graph isn't required.

func (*Scheduler) GetGraphImage

func (s *Scheduler) GetGraphImage() (image.Image, error)

GetGraphImage draws current graph's image

func (*Scheduler) GetGraphState

func (s *Scheduler) GetGraphState(logLabels map[string]string) ([]string, map[string]bool, error)

GetGraphState returns: * list of enabled modules if not nil * current modules diff * error if any if s.enabledModules is nil, we infer that the graph hasn't been calculated yet and run RecalculateGraph for the first time. if s.errList isn't empty, we try to recalculate the graph in case there were some minor errors last time.

func (*Scheduler) GetModuleNodes

func (s *Scheduler) GetModuleNodes() ([]*node.Node, error)

GetModuleNodes traverses the graph in DFS-way and returns all Module-type vertices

func (*Scheduler) IsModuleEnabled

func (s *Scheduler) IsModuleEnabled(moduleName string) bool

func (*Scheduler) PrintSummary

func (s *Scheduler) PrintSummary() (map[string]bool, error)

PrintSummary returns resulting consisting of all module-type vertices, their states and last applied extenders

func (*Scheduler) RecalculateGraph

func (s *Scheduler) RecalculateGraph(logLabels map[string]string) (bool, []string)

RecalculateGraph is a public version of recalculateGraphState()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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