scheduler

package
v0.0.0-...-25da3cc Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Balance_LowerLoad = iota //balance by lower load
	Balance_JobCount
	Balance_CpuRate
	Balance_MemoryRate
)

Variables

View Source
var ErrorNotExistsEnoughResource = errors.New("not exists enough resource")
View Source
var ErrorNotSupportBalanceType = errors.New("not support balance type")

Functions

This section is empty.

Types

type Scheduler

type Scheduler interface {
	SetResource(resource *core.ResourceInfo)
	Resources() map[string]*core.ResourceInfo
	LoadResource(endPoint string) *core.ResourceInfo
	Schedule(balanceType int) ([]*core.ResourceInfo, error)
}

func NewScheduler

func NewScheduler() Scheduler

type StandardScheduler

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

func (*StandardScheduler) LoadResource

func (s *StandardScheduler) LoadResource(endPoint string) *core.ResourceInfo

LoadResource load resource by endPoint

func (*StandardScheduler) Resources

func (s *StandardScheduler) Resources() map[string]*core.ResourceInfo

GetResources return scheduler's resources

func (*StandardScheduler) Schedule

func (s *StandardScheduler) Schedule(balanceType int) ([]*core.ResourceInfo, error)

Schedule

func (*StandardScheduler) SetResource

func (s *StandardScheduler) SetResource(resource *core.ResourceInfo)

RefreshResource refresh resource value

Jump to

Keyboard shortcuts

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