Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScheduleAppReplica ¶
type ScheduleHitItem ¶
type ScheduleHitItem struct {
HostId string
Volumes []*ScheduleHitVolume
Host *ScheduleHostItem
}
type ScheduleHitVolume ¶
type ScheduleHostItem ¶
type ScheduleHostItem struct {
Id string `json:"id" toml:"id"`
OpAction []string `json:"op_action,omitempty" toml:"op_action,omitempty"`
CpuTotal int64 `json:"cpu_total,omitempty" toml:"cpu_total,omitempty"` // mCores (1 core = 1000m)
CpuUsed int64 `json:"cpu_used,omitempty" toml:"cpu_used,omitempty"` // mCores (1 core = 1000m)
CpuAlloc int64 `json:"cpu_alloc,omitempty" toml:"cpu_alloc,omitempty"` // mCores (1 core = 1000m)
MemTotal int64 `json:"mem_total,omitempty" toml:"mem_total,omitempty"` // Bytes
MemUsed int64 `json:"mem_used,omitempty" toml:"mem_used,omitempty"` // Bytes
MemAlloc int64 `json:"mem_alloc,omitempty" toml:"mem_alloc,omitempty"` // Bytes
Volumes []*ScheduleHostVolume `json:"volumes" toml:"volumes"`
}
type ScheduleHostList ¶
type ScheduleHostList struct {
Hosts []*ScheduleHostItem `json:"hosts,omitempty" toml:"hosts,omitempty"`
}
type ScheduleHostVolume ¶
type ScheduleOptions ¶
type ScheduleOptions struct {
HostExcludes []string
}
type Scheduler ¶
type Scheduler interface {
//
ScheduleHost(
rep *ScheduleAppReplica,
hostls *ScheduleHostList,
opts *ScheduleOptions,
) (
hit *ScheduleHitItem,
err error,
)
//
ScheduleHostValid(
host *ScheduleHostItem,
entry *ScheduleAppReplica,
) (
err error,
)
}
Scheduler is an interface implemented by things that know how to schedule apps onto hosts.
func NewScheduler ¶
func NewScheduler() Scheduler
Click to show internal directories.
Click to hide internal directories.