Documentation ¶
Index ¶
- Constants
- type ContextData
- type ContextKey
- type Plugin
- type PluginContext
- func (c *PluginContext) Delete(key ContextKey)
- func (c *PluginContext) Read(key ContextKey) (ContextData, error)
- func (c *PluginContext) Reset()
- func (c *PluginContext) SyncDelete(key ContextKey)
- func (c *PluginContext) SyncRead(key ContextKey) (ContextData, error)
- func (c *PluginContext) SyncWrite(key ContextKey, val ContextData)
- func (c *PluginContext) Write(key ContextKey, val ContextData)
- type PluginData
- type PluginSet
- type PrebindPlugin
- type ReservePlugin
Constants ¶
const (
// NotFound is the not found error message.
NotFound = "not found"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextData ¶
type ContextData interface{}
ContextData is a generic type for arbitrary data stored in PluginContext.
type Plugin ¶
type Plugin interface {
Name() string
}
Plugin is the parent type for all the scheduling framework plugins.
type PluginContext ¶
PluginContext provides a mechanism for plugins to store and retrieve arbitrary data. ContextData stored by one plugin can be read, altered, or deleted by another plugin. PluginContext does not provide any data protection, as all plugins are assumed to be trusted.
func NewPluginContext ¶
func NewPluginContext() *PluginContext
NewPluginContext initializes a new PluginContext and returns its pointer.
func (*PluginContext) Delete ¶
func (c *PluginContext) Delete(key ContextKey)
Delete deletes data with the given key from PluginContext.
func (*PluginContext) Read ¶
func (c *PluginContext) Read(key ContextKey) (ContextData, error)
Read retrieves data with the given "key" from PluginContext. If the key is not present an error is returned.
func (*PluginContext) Reset ¶
func (c *PluginContext) Reset()
Reset removes all the information in the PluginContext.
func (*PluginContext) SyncDelete ¶
func (c *PluginContext) SyncDelete(key ContextKey)
SyncDelete is the thread safe version of Write(...).
func (*PluginContext) SyncRead ¶
func (c *PluginContext) SyncRead(key ContextKey) (ContextData, error)
SyncRead is the thread safe version of Read(...).
func (*PluginContext) SyncWrite ¶
func (c *PluginContext) SyncWrite(key ContextKey, val ContextData)
SyncWrite is the thread safe version of Write(...).
func (*PluginContext) Write ¶
func (c *PluginContext) Write(key ContextKey, val ContextData)
Write stores the given "val" in PluginContext with the given "key".
type PluginData ¶
type PluginData struct { Ctx *PluginContext SchedulerCache *cache.Cache }
PluginData carries information that plugins may need.
type PluginSet ¶
type PluginSet interface { Data() *PluginData ReservePlugins() []ReservePlugin PrebindPlugins() []PrebindPlugin }
PluginSet registers plugins used by the scheduling framework. The plugins registered are called at specified points in an scheduling cycle.
type PrebindPlugin ¶
type PrebindPlugin interface { Plugin // Prebind is called before binding a pod. All prebind plugins must return // or the pod will not be sent for binding. Prebind(ps PluginSet, p *v1.Pod, nodeName string) (bool, error) }
PrebindPlugin is an interface that must be implemented by "prebind" plugins. These plugins are called before a pod being scheduled
type ReservePlugin ¶
type ReservePlugin interface { Plugin // Reserve is called by the scheduling framework when the scheduler cache is // updated. Reserve(ps PluginSet, p *v1.Pod, nodeName string) error }
ReservePlugin is an interface for Reserve plugins. These plugins are called at the reservation point, AKA "assume". These are meant to updated the state of the plugin. They do not return any value (other than error).