snapshot

package
v1.17.17 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNodeInfoMap

func CreateNodeInfoMap(pods []*v1.Pod, nodes []*v1.Node) map[string]*schedulernodeinfo.NodeInfo

CreateNodeInfoMap obtains a list of pods and pivots that list into a map where the keys are node names and the values are the aggregated information for that node.

Types

type Snapshot

type Snapshot struct {
	// NodeInfoMap a map of node name to a snapshot of its NodeInfo.
	NodeInfoMap map[string]*schedulernodeinfo.NodeInfo
	// NodeInfoList is the list of nodes as ordered in the cache's nodeTree.
	NodeInfoList []*schedulernodeinfo.NodeInfo
	// HavePodsWithAffinityNodeInfoList is the list of nodes with at least one pod declaring affinity terms.
	HavePodsWithAffinityNodeInfoList []*schedulernodeinfo.NodeInfo
	Generation                       int64
}

Snapshot is a snapshot of cache NodeInfo and NodeTree order. The scheduler takes a snapshot at the beginning of each scheduling cycle and uses it for its operations in that cycle.

func NewEmptySnapshot

func NewEmptySnapshot() *Snapshot

NewEmptySnapshot initializes a Snapshot struct and returns it.

func NewSnapshot

func NewSnapshot(nodeInfoMap map[string]*schedulernodeinfo.NodeInfo) *Snapshot

NewSnapshot initializes a Snapshot struct and returns it.

func (*Snapshot) ListNodes

func (s *Snapshot) ListNodes() []*v1.Node

ListNodes returns the list of nodes in the snapshot.

func (*Snapshot) NodeInfos

func (s *Snapshot) NodeInfos() schedulerlisters.NodeInfoLister

NodeInfos returns a NodeInfoLister.

func (*Snapshot) Pods

Pods returns a PodLister

Jump to

Keyboard shortcuts

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