podstore

package
v0.0.0-...-dcfb068 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const Name commonstores.StoreName = "PodStore"

Variables

This section is empty.

Functions

func NewCache

func NewCache(handler handler.CacheHandler) commonstores.CommonStore

func NewSnapshot

func NewSnapshot(handler handler.CacheHandler) commonstores.CommonStore

Types

type PodStore

type PodStore struct {
	commonstores.BaseStore

	// a set of assumed pod keys.
	// The key could further be used to get an entry in PodStates.
	AssumedPods map[string]bool
	// a map from pod key to podState.
	PodStates map[string]*framework.CachePodState
	// contains filtered or unexported fields
}

func (*PodStore) AddPod

func (s *PodStore) AddPod(pod *v1.Pod) error

func (*PodStore) AssumePod

func (s *PodStore) AssumePod(podInfo *framework.CachePodInfo) error

func (*PodStore) CleanupExpiredAssumedPods

func (s *PodStore) CleanupExpiredAssumedPods(mu *sync.RWMutex, now time.Time)

cleanupAssumedPods exists for making test deterministic by taking time as input argument. It also reports metrics on the cache size for nodes, pods, and assumed pods.

func (*PodStore) FinishReserving

func (s *PodStore) FinishReserving(pod *v1.Pod, now time.Time) error

func (*PodStore) ForgetPod

func (s *PodStore) ForgetPod(podInfo *framework.CachePodInfo) error

func (*PodStore) GetPod

func (s *PodStore) GetPod(pod *v1.Pod) (*v1.Pod, error)

func (*PodStore) GetPodState

func (s *PodStore) GetPodState(key string) (*framework.CachePodState, bool)

func (*PodStore) IsAssumedPod

func (s *PodStore) IsAssumedPod(pod *v1.Pod) (bool, error)

func (*PodStore) IsCachedPod

func (s *PodStore) IsCachedPod(pod *v1.Pod) (bool, error)

func (*PodStore) Name

func (c *PodStore) Name() commonstores.StoreName

func (*PodStore) PeriodWorker

func (s *PodStore) PeriodWorker(mu *sync.RWMutex)

func (*PodStore) RemovePod

func (s *PodStore) RemovePod(pod *v1.Pod) error

func (*PodStore) UpdatePod

func (s *PodStore) UpdatePod(oldPod *v1.Pod, newPod *v1.Pod) error

ATTENTION: Previously, assumed pods were converted to bound pods by AddPod, but this is actually a pod update event. At this point, the oldPod does not carry information about the assume, so you MUST try to get the state of the once-assumed pod from the Cache.

func (*PodStore) UpdateSnapshot

func (s *PodStore) UpdateSnapshot(_ commonstores.CommonStore) error

Jump to

Keyboard shortcuts

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