scheduler

package
v0.0.0-...-4f4fead Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

Load loads scheduling algorithms for each runtime specified in the manifest

Types

type Algorithm

type Algorithm interface {
	// Get the active containers for the runtime
	GetActiveContainers(rt *manifest.ManifestRuntime) ([]types.Container, error)

	// Get the next container to run the execution
	GetNextExecutor(rt *manifest.ManifestRuntime) (types.Container, error)
}

Algorithm interface for scheduling algorithms

type RandomScheduler

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

RandomScheduler random scheduling algorithm

func NewRandomScheduler

func NewRandomScheduler(r *runtime_manager.RuntimeManager) *RandomScheduler

NewRandomScheduler returns an instance of RandomScheduler

func (*RandomScheduler) GetActiveContainers

func (s *RandomScheduler) GetActiveContainers(rt *manifest.ManifestRuntime) ([]types.Container, error)

GetActiveContainers get the containers available for execution

func (*RandomScheduler) GetNextExecutor

func (s *RandomScheduler) GetNextExecutor(rt *manifest.ManifestRuntime) (c types.Container, err error)

GetNextExecutor randomly selects a container from the available containers

type RoundRobinScheduler

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

RoundRobinScheduler round robin scheduling algorithm

func NewRoundRobinScheduler

func NewRoundRobinScheduler(r *runtime_manager.RuntimeManager) *RoundRobinScheduler

NewRoundRobinScheduler create a new instance of the round robin scheduler

func (*RoundRobinScheduler) GetActiveContainers

func (s *RoundRobinScheduler) GetActiveContainers(rt *manifest.ManifestRuntime) ([]types.Container, error)

GetActiveContainers get the current containers active for the specified runtime

func (*RoundRobinScheduler) GetNextExecutor

func (s *RoundRobinScheduler) GetNextExecutor(rt *manifest.ManifestRuntime) (c types.Container, err error)

GetNextExecutor uses the round robin algorithm To determine which container to use for the next execution

type Scheduler

type Scheduler struct {
	Random     *RandomScheduler
	RoundRobin *RoundRobinScheduler
}

Scheduler determines which container to use in executions

Jump to

Keyboard shortcuts

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