backoff

package
v0.0.0-...-386b7fa Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backoff

type Backoff interface {
	// Backoff execution for the given node group. Returns time till execution is backed off.
	Backoff(nodeGroup cloudprovider.NodeGroup, nodeInfo *schedulernodeinfo.NodeInfo, errorClass cloudprovider.InstanceErrorClass, errorCode string, currentTime time.Time) time.Time
	// IsBackedOff returns true if execution is backed off for the given node group.
	IsBackedOff(nodeGroup cloudprovider.NodeGroup, nodeInfo *schedulernodeinfo.NodeInfo, currentTime time.Time) bool
	// RemoveBackoff removes backoff data for the given node group.
	RemoveBackoff(nodeGroup cloudprovider.NodeGroup, nodeInfo *schedulernodeinfo.NodeInfo)
	// RemoveStaleBackoffData removes stale backoff data.
	RemoveStaleBackoffData(currentTime time.Time)
}

Backoff allows time-based backing off of node groups considered in scale up algorithm

func NewExponentialBackoff

func NewExponentialBackoff(
	initialBackoffDuration time.Duration,
	maxBackoffDuration time.Duration,
	backoffResetTimeout time.Duration,
	nodeGroupKey func(nodeGroup cloudprovider.NodeGroup) string) Backoff

NewExponentialBackoff creates an instance of exponential backoff.

func NewIdBasedExponentialBackoff

func NewIdBasedExponentialBackoff(initialBackoffDuration time.Duration, maxBackoffDuration time.Duration, backoffResetTimeout time.Duration) Backoff

NewIdBasedExponentialBackoff creates an instance of exponential backoff with node group Id used as a key.

Jump to

Keyboard shortcuts

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