Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNoSuchStrategy = errors.New("no such scheduler strategy")
)
Functions ¶
func ScoreHosts ¶
func ScoreHosts(service ServiceConfig, hosts []Host) ([]*ScoredHost, []*ScoredHost)
ScoreHosts returns two arrays of hosts. The first lists hosts that have enough resources to handle the service, sorted in order of combined free resources. The second lists hosts that do not have enough resources to handle the service, sorted in order of percentage memory used were the service deployed to the host.
Types ¶
type BalanceStrategy ¶
type BalanceStrategy struct{}
func (*BalanceStrategy) Name ¶
func (s *BalanceStrategy) Name() string
func (*BalanceStrategy) SelectHost ¶
func (s *BalanceStrategy) SelectHost(service ServiceConfig, hosts []Host) (Host, error)
type Host ¶
type Host interface { HostID() string TotalCores() int TotalMemory() uint64 RunningServices() []ServiceConfig }
type PackStrategy ¶
type PackStrategy struct{}
func (*PackStrategy) Name ¶
func (s *PackStrategy) Name() string
func (*PackStrategy) SelectHost ¶
func (s *PackStrategy) SelectHost(service ServiceConfig, hosts []Host) (Host, error)
type PreferSeparateStrategy ¶
type PreferSeparateStrategy struct{}
func (*PreferSeparateStrategy) Name ¶
func (s *PreferSeparateStrategy) Name() string
func (*PreferSeparateStrategy) SelectHost ¶
func (s *PreferSeparateStrategy) SelectHost(service ServiceConfig, hosts []Host) (Host, error)
type RequireSeparateStrategy ¶
type RequireSeparateStrategy struct{}
func (*RequireSeparateStrategy) Name ¶
func (s *RequireSeparateStrategy) Name() string
func (*RequireSeparateStrategy) SelectHost ¶
func (s *RequireSeparateStrategy) SelectHost(service ServiceConfig, hosts []Host) (Host, error)
type ScoredHost ¶
type ServiceConfig ¶
type ServiceConfig interface { GetServiceID() string RequestedCorePercent() int RequestedMemoryBytes() uint64 HostPolicy() servicedefinition.HostPolicy }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.