Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFaultRoute ¶
mirror 点: 检查自己的master是否alive,如不alive替换为 mirrorBack 查看mirrorBack是不是自身,是自身读取对应的Master back路由信息 master点: 简单删除失效mirror点即可
func GetTargetsNum ¶
Types ¶
type Graph ¶
type Graph interface { // GetNodeCount returns the total number of nodes. GetNodeCount() int // GetNode finds the Node. It returns nil if the Node // does not exist in the graph. GetNode(id int) Node // GetNodes returns a map from node int64 to // empty struct value. Graph does not allow duplicate // node int64 or name. GetNodes() map[int]Node // AddNode adds a node to a graph, and returns false // if the node already existed in the graph. AddNode(nd Node) bool // AddEdge adds an edge from nd1 to nd2 with the weight. // It returns error if a node does not exist. AddEdge(id1, id2 int, weight float32) IsMaster(id int) bool IsMirror(id int) bool AddMirror(id int, masterWR int) GetMirrors() map[int]int GetMirrorBacks() map[int]int AddMaster(id int, routeMsg []int) GetMasters() map[int][]int GetSources(id int) map[int]float32 // GetTargets returns the map of child Nodes. // (Nodes that go out of the argument vertex.) GetTargets(id int) []int GetWeights(id int) []float32 GetEdgeNum() int64 GetBackNodes() []int }
Graph describes the methods of graph operations. It assumes that the identifier of a Node is unique. And weight values is float64.
func NewGraphFromTXT ¶
Click to show internal directories.
Click to hide internal directories.