framework

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 2 Imported by: 0

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 NewCycleState

func NewCycleState() *CycleState

NewCycleState creates a CycleState.

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 StateKey

type StateKey string

StateKey is the key for a state value stored in a CycleState.

type StateValue

type StateValue interface{}

StateValue is the value stored in a CycleState under a specific key.

Jump to

Keyboard shortcuts

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