node

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

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

Go to latest
Published: Feb 12, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//NodeContainer Work node list
	NodeContainer *WorkerNodeContainer = &WorkerNodeContainer{nodeList: make([]*Node, 0, MaxNodeNumber), workID2Index: make(map[uint32]int)}
	//MaxNodeNumber max node number
	MaxNodeNumber uint = 64
)

Functions

This section is empty.

Types

type Node

type Node struct {
	IP            string
	Port          int32
	WorkerID      uint32
	Stat          *pb.Stat
	ServiceStatus pb.ServiceStatus
}

Node store a server info

type WorkerNodeContainer

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

WorkerNodeContainer collection worker node list

func (*WorkerNodeContainer) DeleteNode

func (ws *WorkerNodeContainer) DeleteNode(workerid uint32)

DeleteNode delete a worker node

func (*WorkerNodeContainer) GetNodeList

func (ws *WorkerNodeContainer) GetNodeList() []*Node

GetNodeList get the node list

func (*WorkerNodeContainer) GetNodeListLen

func (ws *WorkerNodeContainer) GetNodeListLen() int

GetNodeListLen get the length

func (*WorkerNodeContainer) InsertNode

func (ws *WorkerNodeContainer) InsertNode(workerid uint32, node *Node)

InsertNode insert a worker node

func (*WorkerNodeContainer) UpdateNodeServiceStatus

func (ws *WorkerNodeContainer) UpdateNodeServiceStatus(workerid uint32, status pb.ServiceStatus)

UpdateNodeServiceStatus delete a worker node

func (*WorkerNodeContainer) UpdateNodeStat

func (ws *WorkerNodeContainer) UpdateNodeStat(workerid uint32, stat *pb.Stat)

UpdateNodeStat delete a worker node

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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