Documentation ¶
Index ¶
- type Scheduler
- func (s *Scheduler) AddExtender(ext extenders.Extender) error
- func (s *Scheduler) AddModuleVertex(module node.ModuleInterface) error
- func (s *Scheduler) AddWeightVertex(vertex *node.Node) error
- func (s *Scheduler) ApplyExtenders(extendersEnv string) error
- func (s *Scheduler) EventCh() chan extenders.ExtenderEvent
- func (s *Scheduler) Filter(extName extenders.ExtenderName, moduleName string, logLabels map[string]string) (*bool, error)
- func (s *Scheduler) GetEnabledModuleNames() []string
- func (s *Scheduler) GetGraphImage() (image.Image, error)
- func (s *Scheduler) GetGraphState(logLabels map[string]string) ([]string, map[string]bool, error)
- func (s *Scheduler) GetModuleNodes() ([]*node.Node, error)
- func (s *Scheduler) IsModuleEnabled(moduleName string) bool
- func (s *Scheduler) PrintSummary() (map[string]bool, error)
- func (s *Scheduler) RecalculateGraph(logLabels map[string]string) (bool, []string)
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 ¶
NewScheduler returns a new instance of scheduler
func (*Scheduler) AddExtender ¶
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 ¶
AddWeightVertex adds a new vertex of type Weight to the graph
func (*Scheduler) ApplyExtenders ¶
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 ¶
GetEnabledModuleNames returns a list of all enabled module-type vertices from s.enabledModules so that traversing the graph isn't required.
func (*Scheduler) GetGraphImage ¶
GetGraphImage draws current graph's image
func (*Scheduler) GetGraphState ¶
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 ¶
GetModuleNodes traverses the graph in DFS-way and returns all Module-type vertices
func (*Scheduler) IsModuleEnabled ¶
func (*Scheduler) PrintSummary ¶
PrintSummary returns resulting consisting of all module-type vertices, their states and last applied extenders