cluster

package
v0.0.0-...-2f23b2c Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_WEIGHT        = 100
	MEDIAN_WEIGHT     = 50
	MIN_DISK_TO_WORRY = 0.000809804
	DEGRADED_WEIGHT   = 30
)
View Source
const (
	MAX_ERAS_SAVED = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BBHost

type BBHost struct {
	Disk_free float32
	Load      float32
	Name      string
	Ip        string
	Port      int
}

type BBResult

type BBResult struct {
	Nodes []BBHost
}

type DynamicBBManager

type DynamicBBManager struct {
	Eras        map[time.Time]Era
	ErasAdded   []time.Time
	BBHosts     []string
	CurrentTime time.Time
}

func NewDynamicBBManager

func NewDynamicBBManager(bbHosts []string) *DynamicBBManager

func (*DynamicBBManager) GetCurrentEra

func (c *DynamicBBManager) GetCurrentEra() Era

func (*DynamicBBManager) GetEra

func (c *DynamicBBManager) GetEra(t time.Time) Era

type Era

type Era interface {
	GetNodes() []Node
}

type GoServiceNode

type GoServiceNode interface {
	Name() string
	Ip() string
	Port() string
}

type Manager

type Manager interface {
	GetEra(t time.Time) Era
	GetCurrentEra() Era
}

There should be a separate manager for each service

type Node

type Node interface {
	Name() string
}

type SimpleEra

type SimpleEra struct {
	// contains filtered or unexported fields
}

func NewSimpleEra

func NewSimpleEra() *SimpleEra

func (*SimpleEra) Add

func (s *SimpleEra) Add(n Node)

func (*SimpleEra) GetNodes

func (s *SimpleEra) GetNodes() []Node

type SimpleNode

type SimpleNode struct {
	// contains filtered or unexported fields
}

func NewSimpleNode

func NewSimpleNode(name string, ip string, port string) *SimpleNode

func (*SimpleNode) Ip

func (n *SimpleNode) Ip() string

func (*SimpleNode) Name

func (n *SimpleNode) Name() string

func (*SimpleNode) Port

func (n *SimpleNode) Port() string

type StaticManager

type StaticManager struct {
	E Era
}

func NewStaticManager

func NewStaticManager(e Era) *StaticManager

func (*StaticManager) GetCurrentEra

func (c *StaticManager) GetCurrentEra() Era

func (*StaticManager) GetEra

func (c *StaticManager) GetEra(t time.Time) Era

type WeightedEra

type WeightedEra struct {
	// contains filtered or unexported fields
}

func NewWeightedEra

func NewWeightedEra() *WeightedEra

func (*WeightedEra) Add

func (s *WeightedEra) Add(n Node)

func (*WeightedEra) GetNode

func (s *WeightedEra) GetNode(posit int) *WeightedNode

func (*WeightedEra) GetNodes

func (s *WeightedEra) GetNodes() []Node

func (*WeightedEra) NormalizeAndPopulateMap

func (s *WeightedEra) NormalizeAndPopulateMap()

type WeightedNode

type WeightedNode struct {
	// contains filtered or unexported fields
}

func NewWeightedNode

func NewWeightedNode(name string, ip string, port string, disk float32, load float32) *WeightedNode

func (*WeightedNode) Ip

func (n *WeightedNode) Ip() string

func (*WeightedNode) Name

func (n *WeightedNode) Name() string

func (*WeightedNode) Port

func (n *WeightedNode) Port() string

Jump to

Keyboard shortcuts

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