cache

package
v0.0.0-...-50759bc Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 20 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 {
	// Run start informer
	Run(stopCh <-chan struct{})

	// Snapshot deep copy overall cache information into snapshot
	Snapshot() *api.ClusterInfo

	// SchedulerConf return the property of scheduler configuration
	LoadConf(path string) (map[string]string, error)

	// WaitForCacheSync waits for all cache synced
	WaitForCacheSync(stopCh <-chan struct{}) bool

	// Obtains current cluster unallocated resources.
	GetUnallocatedResources() *api.Resource
}

Cache collects pods/nodes/queues information and provides information snapshot

func New

func New(config *rest.Config) Cache

New returns a Cache implementation.

type ClusterStateCache

type ClusterStateCache struct {
	sync.Mutex

	Jobs  map[api.JobID]*api.JobInfo
	Nodes map[string]*api.NodeInfo
	// contains filtered or unexported fields
}

func (*ClusterStateCache) AddNode

func (sc *ClusterStateCache) AddNode(obj interface{})

func (*ClusterStateCache) AddPDB

func (sc *ClusterStateCache) AddPDB(obj interface{})

func (*ClusterStateCache) AddPod

func (sc *ClusterStateCache) AddPod(obj interface{})

func (*ClusterStateCache) AddSchedulingSpec

func (sc *ClusterStateCache) AddSchedulingSpec(obj interface{})

func (*ClusterStateCache) DeleteNode

func (sc *ClusterStateCache) DeleteNode(obj interface{})

func (*ClusterStateCache) DeletePDB

func (sc *ClusterStateCache) DeletePDB(obj interface{})

func (*ClusterStateCache) DeletePod

func (sc *ClusterStateCache) DeletePod(obj interface{})

func (*ClusterStateCache) DeleteSchedulingSpec

func (sc *ClusterStateCache) DeleteSchedulingSpec(obj interface{})

func (*ClusterStateCache) GetResourceCapacities

func (sc *ClusterStateCache) GetResourceCapacities() *api.Resource

Gets the full capacity of resources in the cluster

func (*ClusterStateCache) GetUnallocatedResources

func (sc *ClusterStateCache) GetUnallocatedResources() *api.Resource

Gets available free resoures.

func (*ClusterStateCache) LoadConf

func (sc *ClusterStateCache) LoadConf(path string) (map[string]string, error)

func (*ClusterStateCache) Run

func (sc *ClusterStateCache) Run(stopCh <-chan struct{})

func (*ClusterStateCache) Snapshot

func (sc *ClusterStateCache) Snapshot() *api.ClusterInfo

func (*ClusterStateCache) String

func (sc *ClusterStateCache) String() string

func (*ClusterStateCache) UpdateNode

func (sc *ClusterStateCache) UpdateNode(oldObj, newObj interface{})

func (*ClusterStateCache) UpdatePDB

func (sc *ClusterStateCache) UpdatePDB(oldObj, newObj interface{})

func (*ClusterStateCache) UpdatePod

func (sc *ClusterStateCache) UpdatePod(oldObj, newObj interface{})

func (*ClusterStateCache) UpdateSchedulingSpec

func (sc *ClusterStateCache) UpdateSchedulingSpec(oldObj, newObj interface{})

func (*ClusterStateCache) WaitForCacheSync

func (sc *ClusterStateCache) WaitForCacheSync(stopCh <-chan struct{}) bool

Jump to

Keyboard shortcuts

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