Documentation
¶
Overview ¶
This is a simple example of routing to showcase distributed graph processing in Beehive.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallRouting ¶
InstallRouting installs the routing application on bh.DefaultHive. timeout is the duration between each epoc of routing advertisements.
Types ¶
type Discovery ¶
type Discovery Edge
Discovery is a message emitted when an edge between two nodes is discovered.
type Node ¶
type Node struct { ID string // ID of this node. Endhost bool // Whether it is an end-host (important dst for routing). }
Node represents a vertex in the graph.
type Path ¶
type Path []Node
Path represents a directed path between two nodes.
func (Path) Append ¶
Append creates a copy of the path, appends n to the path, and returns that copy. It will not directly modify the path. It returns error if the resulting path is an invalid path.
type PathByLen ¶
type PathByLen []Path
PathByLen is used to sort a []Path based on the length of paths. It implements sort.Interface for []Path.
type Route ¶
type Route struct { To Node Paths []Path // Paths is sorted based on Path.Len(). Updates []Path // The new routes that may be used for advertisement. }
Route is a collection of paths towards a desintation node.
func (Route) IsShortestPath ¶
IsShortestPath returns whether path is a shortest path.
func (Route) KShortestPaths ¶
KShortestPaths returns the k shortest paths in this route. If k is larger than the number of paths we have, we return all the paths.
func (*Route) RemovePath ¶
RemovePath removes a path from this route.
func (Route) ShortestPaths ¶
ShortestPaths returns all the paths of shortest length in this route.
type Router ¶
type Router struct{}
Router is the main handler of the routing application.
func (Router) Map ¶
func (r Router) Map(msg bh.Msg, ctx bh.MapContext) bh.MappedCells
Rcv maps Discovery based on its destination node and Advertisement messages based on their source node.
type RoutingTable ¶
Routing table represents the route for each destination node.