scheduler

package
v2.0.0-alpha.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleAppReplica

type ScheduleAppReplica struct {
	RepId uint64
	Cpu   int64 // mCores (1 core = 1000m)
	Mem   int64 // Bytes
	Vol   int64 // Bytes
}

type ScheduleHitItem

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

type ScheduleHitVolume

type ScheduleHitVolume struct {
	Name string `json:"name" toml:"name"`
	Size int64  `json:"size" toml:"size"` // Bytes
}

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 ScheduleHostVolume struct {
	Name string `json:"name" toml:"name"`

	Total int64 `json:"total" toml:"total"` // Bytes
	Used  int64 `json:"used" toml:"used"`   // Bytes
	Alloc int64 `json:"alloc" toml:"alloc"` // Bytes

}

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

Jump to

Keyboard shortcuts

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