bab

package
v0.0.0-...-dacd781 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFilterPods

func NewFilterPods(pods []*v1.Pod, CapicityCoreAndMen float64) fiterPods

func ScheduleNode

func ScheduleNode(pods []*v1.Pod, host *v1.Node) []int

Types

type NodeInfo

type NodeInfo struct {
	Parent *NodeInfo
	//b&b use
	Profit   float64
	Allocate Weight
	Bound    float64
	Capicity Weight
	//is pod should be choose and pod index in queue
	Pod        *PodInfo
	Take       bool
	Index      int
	SearchJump int
	//heap index
	QIndex int
}

func NewNodeInfo

func NewNodeInfo(capicity Weight) *NodeInfo

func (*NodeInfo) FindChildren

func (node *NodeInfo) FindChildren(pods fiterPods) []*NodeInfo

func (*NodeInfo) Search

func (node *NodeInfo) Search(pods fiterPods) int

func (*NodeInfo) SetBound

func (node *NodeInfo) SetBound(pods fiterPods)

func (*NodeInfo) SetIndexs

func (node *NodeInfo) SetIndexs(pods fiterPods)

func (*NodeInfo) SetPod

func (node *NodeInfo) SetPod(pods fiterPods)

func (*NodeInfo) SetProfit

func (node *NodeInfo) SetProfit(pods fiterPods)

func (*NodeInfo) SetWeight

func (node *NodeInfo) SetWeight(pods fiterPods)

func (*NodeInfo) ShowChoices

func (node *NodeInfo) ShowChoices() []*PodInfo

type PodInfo

type PodInfo struct {
	//generated id(unique)
	Id string
	//index in []v1.Pod
	Index int
	//pod request
	Weight
	//node usage
	Usage float64
}

func NewPodInfo

func NewPodInfo(pod *v1.Pod) *PodInfo

func (*PodInfo) ComputeUsage

func (pod *PodInfo) ComputeUsage(CapicityCoreAndMen float64)

func (*PodInfo) SetIndex

func (pod *PodInfo) SetIndex(index int)

type PriorityQueue

type PriorityQueue []*NodeInfo

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

func (PriorityQueue) Less

func (pq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop

func (pq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push

func (pq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap

func (pq PriorityQueue) Swap(i, j int)

type Weight

type Weight struct {
	Core int64
	Mem  int64
}

Jump to

Keyboard shortcuts

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