placement

package
v0.0.0-...-dea5896 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PolicyNames

func PolicyNames() []string

Types

type Policy

type Policy int

Policy is an integer representing the opensvc object placement policy.

const (
	// Invalid is for invalid kinds
	Invalid Policy = iota
	// None is the policy used by special objects like sec, cfg, usr.
	None
	// NodesOrder is the policy where node priorities are assigned to nodes descending from left to right in the nodes list.
	NodesOrder
	// LastStart is the policy where node priorities are assigned to nodes based on instance last start time. The more recent, the higher the priority.
	LastStart
	// LoadAvg is the policy where node priorities are assigned to nodes based on load average. The higher the load, the lower the priority.
	LoadAvg
	// Shift is the policy where node priorities are assigned to nodes based on the scaler slice number.
	Shift
	// Spread is the policy where node priorities are assigned to nodes based on nodename hashing. The node priority is stable as long as the cluster members are stable.
	Spread
	// Score is the policy where node priorities are assigned to nodes based on score. The higher the score, the higher the priority.
	Score
)

func NewPolicy

func NewPolicy(s string) Policy

NewPolicy returns a id from its string representation.

func (Policy) MarshalText

func (t Policy) MarshalText() ([]byte, error)

MarshalText marshals the enum as a quoted json string

func (Policy) String

func (t Policy) String() string

func (*Policy) UnmarshalText

func (t *Policy) UnmarshalText(b []byte) error

UnmarshalText unmashals a quoted json string to the enum value

type State

type State int

State is optimal when the running <n> instances are placed on the <n> first nodes of the candidate list sorted by the selected placement policy.

const (
	Undef State = iota
	NotApplicable
	Optimal
	NonOptimal
)

func (State) MarshalText

func (t State) MarshalText() ([]byte, error)

MarshalText marshals the enum as a quoted json string

func (State) String

func (t State) String() string

func (*State) UnmarshalText

func (t *State) UnmarshalText(b []byte) error

UnmarshalText unmashals a quoted json string to the enum value

Jump to

Keyboard shortcuts

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