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
Click to show internal directories.
Click to hide internal directories.