cache

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	AddCluster(cluster *v1alpha1.Cluster)
	UpdateCluster(cluster *v1alpha1.Cluster)
	DeleteCluster(cluster *v1alpha1.Cluster)
	// Snapshot returns a snapshot of the current clusters info
	Snapshot() *Snapshot
}

Cache is an interface for scheduler internal cache.

func NewCache

func NewCache() Cache

NewCache instantiates a cache used only by scheduler.

type Snapshot

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

Snapshot is a snapshot of cache ClusterInfo. 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 (*Snapshot) GetClusters

func (s *Snapshot) GetClusters() []*framework.ClusterInfo

GetClusters returns all the clusters.

func (*Snapshot) GetReadyClusters added in v0.3.0

func (s *Snapshot) GetReadyClusters() []*framework.ClusterInfo

GetReadyClusters returns the clusters in ready status.

func (*Snapshot) NumOfClusters

func (s *Snapshot) NumOfClusters() int

NumOfClusters returns the number of clusters.

Jump to

Keyboard shortcuts

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