cache

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 7 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 *clusterv1alpha1.Cluster)
	UpdateCluster(cluster *clusterv1alpha1.Cluster)
	DeleteCluster(cluster *clusterv1alpha1.Cluster)
	// Snapshot returns a snapshot of the current clusters info
	Snapshot() *Snapshot
}

Cache is an interface for scheduler internal cache.

func NewCache

func NewCache(clusterLister clusterlister.ClusterLister) 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) GetCluster added in v0.9.0

func (s *Snapshot) GetCluster(clusterName string) *framework.ClusterInfo

GetCluster returns the given clusters.

func (*Snapshot) GetClusters

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

GetClusters returns all the clusters.

func (*Snapshot) GetReadyClusterNames added in v0.8.0

func (s *Snapshot) GetReadyClusterNames() sets.String

GetReadyClusterNames returns the clusterNames in ready status.

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