bullfinch

package
v0.0.0-...-24d1fa5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in Registry and configurations.
	Name                 = "Bullfinch"
	SumAllocatableCpu    = "SumAllocatableCpu"
	SumAllocatableMem    = "SumAllocatableMem"
	SumAllocatableGpuMem = "SumAllocatableGpuMem"
	ScaledResourceName   = "aliyun.com/gpu-mem"
	WorkloadNodeList     = "WorkloadNodeList"
	IdelnessHitNodes     = "xxx.com/idelness-hit-nodes"
	NodeName             = "xxx.com/nodename"
)

Variables

This section is empty.

Functions

func GetStateKeyByNodeAndPlugin

func GetStateKeyByNodeAndPlugin(plugin string, nodeName string) framework.StateKey

func New

New 初始化一个新插件并返回

func NewBullfinchStateData

func NewBullfinchStateData() framework.StateData

Types

type Bullfinch

type Bullfinch struct {
	// contains filtered or unexported fields
}

func (*Bullfinch) Name

func (b *Bullfinch) Name() string

func (*Bullfinch) PreScore

func (b *Bullfinch) PreScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) (status *framework.Status)

type BullfinchStateData

type BullfinchStateData struct {
}

func (*BullfinchStateData) Clone

type Item

type Item struct {
	Value    interface{}
	Priority float64 // 优先级队列中节点的优先级
	// contains filtered or unexported fields
}

Item 优先队列

type PriorityQueue

type PriorityQueue []*Item

PriorityQueue 优先级队列需要实现heap的interface

func (PriorityQueue) Len

func (pq PriorityQueue) Len() int

Len 优先级队列需要实现heap的interface

func (PriorityQueue) Less

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

func (*PriorityQueue) Pop

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

Pop 绑定put方法,将index置为-1是为了标识该数据已经出了优先级队列了

func (*PriorityQueue) Push

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

Push 绑定push方法

func (PriorityQueue) Swap

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

Jump to

Keyboard shortcuts

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