scheduler

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleHitItem

type ScheduleHitItem struct {
	HostId  string
	Volumes []*ScheduleHitVol
	Host    *ScheduleHostItem
}

type ScheduleHitVol

type ScheduleHitVol struct {
	Name string `json:"name" toml:"name"`
	Size int32  `json:"size" toml:"size"`
}

type ScheduleHostItem

type ScheduleHostItem struct {
	Id               string              `json:"id" toml:"id"`
	OpAction         uint32              `json:"op_action,omitempty" toml:"op_action,omitempty"`
	CellId           string              `json:"cell_id,omitempty" toml:"cell_id,omitempty"`
	CpuTotal         int32               `json:"cpu_total,omitempty" toml:"cpu_total,omitempty"` // Cores (1 = .1 cores)
	CpuUsed          int32               `json:"cpu_used,omitempty" toml:"cpu_used,omitempty"`   // Cores (1 = .1 cores)
	MemTotal         int32               `json:"mem_total,omitempty" toml:"mem_total,omitempty"` // MB
	MemUsed          int32               `json:"mem_used,omitempty" toml:"mem_used,omitempty"`   // MB
	Volumes          ScheduleHostVolumes `json:"volumes" toml:"volumes"`
	BoxDockerVersion string              `json:"box_docker_version,omitempty" toml:"box_docker_version,omitempty"`
	BoxPouchVersion  string              `json:"box_pouch_version,omitempty" toml:"box_pouch_version,omitempty"`
}

type ScheduleHostList

type ScheduleHostList struct {
	Items []*ScheduleHostItem `json:"items,omitempty" toml:"items,omitempty"`
}

type ScheduleHostVolume

type ScheduleHostVolume struct {
	Name  string `json:"name" toml:"name"`
	Total int32  `json:"total" toml:"total"` // GB
	Used  int32  `json:"used" toml:"used"`   // GB
	Attrs uint32 `json:"attrs" toml:"attrs"`
}

type ScheduleHostVolumes

type ScheduleHostVolumes []*ScheduleHostVolume

func (*ScheduleHostVolumes) Del

func (ls *ScheduleHostVolumes) Del(name string)

func (*ScheduleHostVolumes) Equal

func (ls *ScheduleHostVolumes) Equal(ls2 []*ScheduleHostVolume) bool

func (*ScheduleHostVolumes) Get

func (*ScheduleHostVolumes) Sync

func (ls *ScheduleHostVolumes) Sync(item *ScheduleHostVolume)

type ScheduleOptions

type ScheduleOptions struct {
	HostExcludes []string
}

type SchedulePodReplica

type SchedulePodReplica struct {
	RepId       uint32
	Cpu         int32 // Cores (1 = .1 cores)
	Mem         int32 // MB
	VolSys      int32 // GB
	VolSysAttrs uint32
}

type SchedulePodSpec

type SchedulePodSpec struct {
	BoxDriver string `json:"box_driver,omitempty" toml:"box_driver,omitempty"`
	CellId    string `json:"cell_id,omitempty" toml:"cell_id,omitempty"`
}

type Scheduler

type Scheduler interface {

	//
	ScheduleHost(
		spec *SchedulePodSpec,
		rep *SchedulePodReplica,
		hostls *ScheduleHostList,
		opts *ScheduleOptions,
	) (
		hit *ScheduleHitItem,
		err error,
	)

	//
	ScheduleHostValid(
		host *ScheduleHostItem,
		entry *SchedulePodReplica,
	) (
		err error,
	)
}

Scheduler is an interface implemented by things that know how to schedule pods onto hosts.

Jump to

Keyboard shortcuts

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