callbacks

package
v0.0.0-...-8040ead Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 0 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessorCallbacks

type ProcessorCallbacks interface {
	// DisableScaleDownForLoop disables scale down for current loop iteration
	DisableScaleDownForLoop()

	// ResetUnneededNodes resets information about any nodes that were previously considered unneeded by scale-down logic.
	// CA will only delete a node if it's unneeded (meets criteria for scale-down) for time specified
	// via --scale-down-unneeded-time. This call resets the timer for all the nodes in the cluster.
	ResetUnneededNodes()

	// SetExtraValue sets arbitrary value for given key. Value storage will be reset at the beginning of each loop iteration.
	// Arbitrary value storage is used to pass information between processors used in extension points.
	SetExtraValue(key string, value interface{})

	// GetExtraValue gets arbitrary value for given key. If value for given key is not found, found=false will be returned.
	GetExtraValue(key string) (value interface{}, found bool)
}

ProcessorCallbacks is interface defining extra callback methods which can be called by processors used in extension points.

type TestProcessorCallbacks

type TestProcessorCallbacks struct {
	// ScaleDownDisabledForLoop marks if scaledown should be disabled for loop
	ScaleDownDisabledForLoop bool
	// ExtraValues stores values set by GetExtraValue
	ExtraValues map[string]interface{}
}

TestProcessorCallbacks is test implementation of ProcessorCallbacks

func NewTestProcessorCallbacks

func NewTestProcessorCallbacks() *TestProcessorCallbacks

NewTestProcessorCallbacks creates new instance of TestProcessorCallbacks

func (*TestProcessorCallbacks) DisableScaleDownForLoop

func (callbacks *TestProcessorCallbacks) DisableScaleDownForLoop()

DisableScaleDownForLoop is implementation of ProcessorCallbacks.DisableScaleDownForLoop

func (*TestProcessorCallbacks) GetExtraValue

func (callbacks *TestProcessorCallbacks) GetExtraValue(key string) (value interface{}, found bool)

GetExtraValue is implementation of ProcessorCallbacks.GetExtraValue

func (*TestProcessorCallbacks) Reset

func (callbacks *TestProcessorCallbacks) Reset()

Reset resets TestProcessorCallbacks

func (*TestProcessorCallbacks) ResetUnneededNodes

func (callbacks *TestProcessorCallbacks) ResetUnneededNodes()

ResetUnneededNodes is test implementation, which takes no action

func (*TestProcessorCallbacks) SetExtraValue

func (callbacks *TestProcessorCallbacks) SetExtraValue(key string, value interface{})

SetExtraValue is implementation of ProcessorCallbacks.SetExtraValue

Jump to

Keyboard shortcuts

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