v1alpha1

package
v1.14.3-beta.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
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 ContextKey

type ContextKey string

ContextKey is the type of keys stored in PluginContext.

type Plugin

type Plugin interface {
	Name() string
}

Plugin is the parent type for all the scheduling framework plugins.

type PluginContext

type PluginContext struct {
	Mx sync.RWMutex
	// contains filtered or unexported fields
}

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).

Jump to

Keyboard shortcuts

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