Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CycleState ¶
type CycleState struct {
// contains filtered or unexported fields
}
CycleState is, similar to its namesake in kube-scheduler, provides a way for plugins to store and retrieve arbitrary data during a scheduling cycle. The scheduler also uses this struct to keep some global states during a scheduling cycle; note that these state are only accessible to the scheduler itself, not to plugins.
It uses a sync.Map for concurrency-safe storage.
func (*CycleState) Delete ¶
func (c *CycleState) Delete(key StateKey)
Delete deletes a key from CycleState.
func (*CycleState) Read ¶
func (c *CycleState) Read(key StateKey) (StateValue, error)
Read retrieves a value from CycleState by a key.
func (*CycleState) Write ¶
func (c *CycleState) Write(key StateKey, val StateValue)
Write stores a value in CycleState under a key.
type CycleStatePluginReadWriter ¶
type CycleStatePluginReadWriter interface { Read(key StateKey) (StateValue, error) Write(key StateKey, val StateValue) Delete(key StateKey) }
CycleStatePluginReadWriter is an interface through which plugins can store and retrieve data.
type StateValue ¶
type StateValue interface{}
StateValue is the value stored in a CycleState under a specific key.