algo

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Share

func Share(alloc, total float64) float64

Share is used to determine the share

Types

type AffinityQueue

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

AffinityQueue is used to sort pods by Affinity

func NewAffinityQueue

func NewAffinityQueue(pods []*corev1.Pod) *AffinityQueue

NewGreedQueue return a AffinityQueue

func (*AffinityQueue) Len

func (aff *AffinityQueue) Len() int

func (*AffinityQueue) Less

func (aff *AffinityQueue) Less(i, j int) bool

func (*AffinityQueue) Swap

func (aff *AffinityQueue) Swap(i, j int)

type GreedQueue

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

GreedQueue is used to sort pods by Greed Algo

func NewGreedQueue

func NewGreedQueue(nodes []corev1.Node, pods []*corev1.Pod) *GreedQueue

NewGreedQueue return a GreedQueue

func (*GreedQueue) Len

func (greed *GreedQueue) Len() int

func (*GreedQueue) Less

func (greed *GreedQueue) Less(i, j int) bool

func (*GreedQueue) Swap

func (greed *GreedQueue) Swap(i, j int)

type SchedulingQueueSort

type SchedulingQueueSort interface {
	Len() int
	Swap(i, j int)
	Less(i, j int) bool
}

SchedulingQueueSort is interface for sorting pods

type TolerationQueue

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

func NewTolerationQueue

func NewTolerationQueue(pods []*corev1.Pod) *TolerationQueue

func (*TolerationQueue) Len

func (tol *TolerationQueue) Len() int

func (*TolerationQueue) Less

func (tol *TolerationQueue) Less(i, j int) bool

func (*TolerationQueue) Swap

func (tol *TolerationQueue) Swap(i, j int)

Jump to

Keyboard shortcuts

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