Documentation ¶
Index ¶
- Constants
- func NewCache(handler commoncache.CacheHandler) commonstore.Store
- func NewSnapshot(handler commoncache.CacheHandler) commonstore.Store
- type PodStore
- func (s *PodStore) AddPod(pod *v1.Pod) error
- func (s *PodStore) AssumePod(podInfo *framework.CachePodInfo) error
- func (s *PodStore) CleanupExpiredAssumedPods(mu *sync.RWMutex, now time.Time)
- func (s *PodStore) DeletePod(pod *v1.Pod) error
- func (s *PodStore) FinishBinding(pod *v1.Pod, now time.Time) error
- func (s *PodStore) ForgetPod(podInfo *framework.CachePodInfo) error
- func (s *PodStore) GetPod(pod *v1.Pod) (*v1.Pod, error)
- func (s *PodStore) GetPodState(key string) (*framework.CachePodState, bool)
- func (s *PodStore) IsAssumedPod(pod *v1.Pod) (bool, error)
- func (s *PodStore) IsCachedPod(pod *v1.Pod) (bool, error)
- func (s *PodStore) Name() commonstore.StoreName
- func (s *PodStore) PeriodWorker(mu *sync.RWMutex)
- func (s *PodStore) UpdatePod(oldPod *v1.Pod, newPod *v1.Pod) error
- func (s *PodStore) UpdateSnapshot(_ commonstore.Store) error
Constants ¶
View Source
const AssumedPodExpiration = 900 * time.Second
View Source
const Name commonstore.StoreName = "PodStore"
Variables ¶
This section is empty.
Functions ¶
func NewCache ¶
func NewCache(handler commoncache.CacheHandler) commonstore.Store
func NewSnapshot ¶
func NewSnapshot(handler commoncache.CacheHandler) commonstore.Store
Types ¶
type PodStore ¶
type PodStore struct { commonstore.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) CleanupExpiredAssumedPods ¶
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) GetPodState ¶
func (s *PodStore) GetPodState(key string) (*framework.CachePodState, bool)
func (*PodStore) Name ¶
func (s *PodStore) Name() commonstore.StoreName
func (*PodStore) PeriodWorker ¶
func (*PodStore) UpdatePod ¶
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(_ commonstore.Store) error
Click to show internal directories.
Click to hide internal directories.