Documentation ¶
Index ¶
- Constants
- func NewCache(handler commoncache.CacheHandler) commonstore.Store
- func NewSnapshot(handler commoncache.CacheHandler) commonstore.Store
- type ExampleStore
- func (s *ExampleStore) AddPod(pod *v1.Pod) error
- func (s *ExampleStore) AssumePod(podInfo *framework.CachePodInfo) error
- func (s *ExampleStore) DeletePod(pod *v1.Pod) error
- func (s *ExampleStore) ForgetPod(podInfo *framework.CachePodInfo) error
- func (s *ExampleStore) GetPodCount(nodeName string) int
- func (s *ExampleStore) Name() commonstore.StoreName
- func (s *ExampleStore) UpdateNode(oldNode, newNode *v1.Node) error
- func (s *ExampleStore) UpdatePod(oldPod *v1.Pod, newPod *v1.Pod) error
- func (s *ExampleStore) UpdateSnapshot(store commonstore.Store) error
- type StoreHandle
Constants ¶
const Name commonstore.StoreName = "ExampleStore"
Define the index names of the stores, each of which should be different from the other.
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 ExampleStore ¶
type ExampleStore struct { // BaseStore is the `anonymous field` that implements all the ClusterEventsHandler interface as a base class. commonstore.BaseStore // Storage field support customization. // In general, we use generationstore.ListStore in Cache and generationstore.RawStore in snapshot, // and such data structures support multiple levels of nesting. Store generationstore.Store // contains filtered or unexported fields }
ExampleStore implementing the Store interface.
func (*ExampleStore) AssumePod ¶
func (s *ExampleStore) AssumePod(podInfo *framework.CachePodInfo) error
AssumePod/ForgetPod will be called by Cache/Snapshot at the same time. If there is different logic it can be distinguished by storeType.
func (*ExampleStore) ForgetPod ¶
func (s *ExampleStore) ForgetPod(podInfo *framework.CachePodInfo) error
AssumePod/ForgetPod will be called by Cache/Snapshot at the same time. If there is different logic it can be distinguished by storeType.
func (*ExampleStore) GetPodCount ¶
func (s *ExampleStore) GetPodCount(nodeName string) int
func (*ExampleStore) Name ¶
func (s *ExampleStore) Name() commonstore.StoreName
func (*ExampleStore) UpdateNode ¶
func (s *ExampleStore) UpdateNode(oldNode, newNode *v1.Node) error
func (*ExampleStore) 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 (*ExampleStore) UpdateSnapshot ¶
func (s *ExampleStore) UpdateSnapshot(store commonstore.Store) error
UpdateSnapshot synchronize the data in the Cache to Snapshot, generally using generationstore for incremental updates.