nodemanager

package
v0.0.0-...-0fa0486 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZkeInternalIPAnnKey = "zdnscloud.cn/internal-ip"
)

Variables

View Source
var (
	ErrVGNotExist        = errors.New("vg doesn't exist")
	ErrUnknownNode       = errors.New("unknown node")
	ErrNoEnoughFreeSpace = errors.New("no node with enough size")

	ConnectTimeout = 3 * time.Second
)

Functions

This section is empty.

Types

type Node

type Node struct {
	Name     string
	Addr     string
	Size     uint64
	FreeSize uint64
}

type NodeManager

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

func New

func New(c cache.Cache, vgName, labelKey, labelValue string) *NodeManager

func (*NodeManager) AddNode

func (m *NodeManager) AddNode(k8snode *corev1.Node)

func (*NodeManager) Allocate

func (m *NodeManager) Allocate(name string, size uint64) error

func (*NodeManager) DeleteNode

func (m *NodeManager) DeleteNode(name string)

func (*NodeManager) GetNodes

func (m *NodeManager) GetNodes() []Node

func (*NodeManager) GetNodesHasFreeSize

func (m *NodeManager) GetNodesHasFreeSize(size uint64) []string

func (*NodeManager) OnCreate

func (m *NodeManager) OnCreate(e event.CreateEvent) (handler.Result, error)

func (*NodeManager) OnDelete

func (m *NodeManager) OnDelete(e event.DeleteEvent) (handler.Result, error)

func (*NodeManager) OnGeneric

func (m *NodeManager) OnGeneric(e event.GenericEvent) (handler.Result, error)

func (*NodeManager) OnUpdate

func (m *NodeManager) OnUpdate(e event.UpdateEvent) (handler.Result, error)

func (*NodeManager) Release

func (m *NodeManager) Release(name string, size uint64) error

type VGSizeGetter

type VGSizeGetter func(string, string) (uint64, uint64, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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