Documentation ¶
Index ¶
- func BuildNode(name string, alloc v1.ResourceList, labels map[string]string) *v1.Node
- func BuildPod(namespace, name, nodename string, p v1.PodPhase, req v1.ResourceList, ...) *v1.Pod
- func BuildResourceList(cpu string, memory string) v1.ResourceList
- func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
- func CalculateNumOfFeasibleNodesToFind(numAllNodes int32) (numNodes int32)
- func GetNodeList(nodes map[string]*api.NodeInfo) []*api.NodeInfo
- func PredicateNodes(task *api.TaskInfo, nodes []*api.NodeInfo, fn api.PredicateFn) ([]*api.NodeInfo, *api.FitErrors)
- func PrioritizeNodes(task *api.TaskInfo, nodes []*api.NodeInfo, batchFn api.BatchNodeOrderFn, ...) map[float64][]*api.NodeInfo
- func SelectBestNode(nodeScores map[float64][]*api.NodeInfo) *api.NodeInfo
- func SortNodes(nodeScores map[float64][]*api.NodeInfo) []*api.NodeInfo
- func ValidateVictims(preemptor *api.TaskInfo, node *api.NodeInfo, victims []*api.TaskInfo) error
- type FakeBinder
- type FakeEvictor
- type FakeStatusUpdater
- type FakeVolumeBinder
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPod ¶
func BuildPod(namespace, name, nodename string, p v1.PodPhase, req v1.ResourceList, groupName string, labels map[string]string, selector map[string]string) *v1.Pod
BuildPod builts Pod object
func BuildResourceList ¶
func BuildResourceList(cpu string, memory string) v1.ResourceList
BuildResourceList builts resource list object
func BuildResourceListWithGPU ¶
func BuildResourceListWithGPU(cpu string, memory string, GPU string) v1.ResourceList
BuildResourceListWithGPU builts resource list with GPU
func CalculateNumOfFeasibleNodesToFind ¶
CalculateNumOfFeasibleNodesToFind returns the number of feasible nodes that once found, the scheduler stops its search for more feasible nodes.
func GetNodeList ¶
GetNodeList returns values of the map 'nodes'
func PredicateNodes ¶
func PredicateNodes(task *api.TaskInfo, nodes []*api.NodeInfo, fn api.PredicateFn) ([]*api.NodeInfo, *api.FitErrors)
PredicateNodes returns the specified number of nodes that fit a task
func PrioritizeNodes ¶
func PrioritizeNodes(task *api.TaskInfo, nodes []*api.NodeInfo, batchFn api.BatchNodeOrderFn, mapFn api.NodeOrderMapFn, reduceFn api.NodeOrderReduceFn) map[float64][]*api.NodeInfo
PrioritizeNodes returns a map whose key is node's score and value are corresponding nodes
func SelectBestNode ¶
SelectBestNode returns best node whose score is highest, pick one randomly if there are many nodes with same score.
Types ¶
type FakeBinder ¶
FakeBinder is used as fake binder
type FakeEvictor ¶
type FakeEvictor struct { sync.Mutex Channel chan string // contains filtered or unexported fields }
FakeEvictor is used as fake evictor
func (*FakeEvictor) Evict ¶
func (fe *FakeEvictor) Evict(p *v1.Pod, reason string) error
Evict is used by fake evictor to evict pods
func (*FakeEvictor) Evicts ¶
func (fe *FakeEvictor) Evicts() []string
Evicts returns copy of evicted pods.
type FakeStatusUpdater ¶
type FakeStatusUpdater struct { }
FakeStatusUpdater is used for fake status update
func (*FakeStatusUpdater) UpdatePodCondition ¶
func (ftsu *FakeStatusUpdater) UpdatePodCondition(pod *v1.Pod, podCondition *v1.PodCondition) (*v1.Pod, error)
UpdatePodCondition is a empty function
func (*FakeStatusUpdater) UpdatePodGroup ¶
UpdatePodGroup is a empty function
type FakeVolumeBinder ¶
type FakeVolumeBinder struct { }
FakeVolumeBinder is used as fake volume binder
func (*FakeVolumeBinder) AllocateVolumes ¶
func (fvb *FakeVolumeBinder) AllocateVolumes(task *api.TaskInfo, hostname string) error
AllocateVolumes is a empty function
func (*FakeVolumeBinder) BindVolumes ¶
func (fvb *FakeVolumeBinder) BindVolumes(task *api.TaskInfo) error
BindVolumes is a empty function
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue implements a scheduling queue.
func NewPriorityQueue ¶
func NewPriorityQueue(lessFn api.LessFn) *PriorityQueue
NewPriorityQueue returns a PriorityQueue
func (*PriorityQueue) Pop ¶
func (q *PriorityQueue) Pop() interface{}
Pop pops element in the priority Queue
func (*PriorityQueue) Push ¶
func (q *PriorityQueue) Push(it interface{})
Push pushes element in the priority Queue