cache

package
v1.38.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019, 2021 The Multi-Cluster App Dispatcher Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019, 2021 The Multi-Cluster App Dispatcher Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

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

	// Obtains current cluster unallocated histogram of resources
	GetUnallocatedHistograms() map[string]*dto.Metric
}

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

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

func (*ClusterStateCache) AddNode

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

func (*ClusterStateCache) DeleteNode

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

func (*ClusterStateCache) GetResourceCapacities

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

Gets the full capacity of resources in the cluster

func (*ClusterStateCache) GetUnallocatedHistograms

func (sc *ClusterStateCache) GetUnallocatedHistograms() map[string]*dto.Metric

func (*ClusterStateCache) GetUnallocatedResources

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

Gets available free resoures.

func (*ClusterStateCache) GetUnallocatedResourcesHistogram

func (sc *ClusterStateCache) GetUnallocatedResourcesHistogram() *api.ResourceHistogram

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) 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