Package ClusterShell :: Module Propagation :: Class PropagationTreeRouter
[hide private]
[frames] | no frames]

Class PropagationTreeRouter

source code


performs routes resolving operations within a propagation tree. This object provides a next_hop method, that will look for the best directly connected node to use to forward a message to a remote node.

Upon instanciation, the router will parse the topology tree to generate its routing table.

Instance Methods [hide private]
 
__init__(self, root, topology, fanout=0)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
table_generate(self, root, topology)
The router relies on a routing table.
source code
 
dispatch(self, dst)
dispatch nodes from a target nodeset to the directly connected gateways.
source code
 
next_hop(self, dst)
perform the next hop resolution.
source code
 
mark_unreachable(self, dst)
mark node dst as unreachable and don't advertise routes through it anymore.
source code
 
_best_next_hop(self, candidates)
find out a good next hop gateway
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, root, topology, fanout=0)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

table_generate(self, root, topology)

source code 

The router relies on a routing table. The keys are the destination nodes and the values are the next hop gateways to use to reach these nodes.

dispatch(self, dst)

source code 

dispatch nodes from a target nodeset to the directly connected gateways.

The method acts as an iterator, returning a gateway and the associated hosts. It should provide a rather good load balancing between the gateways.

next_hop(self, dst)

source code 

perform the next hop resolution. If several hops are available, then, the one with the least number of current jobs will be returned

mark_unreachable(self, dst)

source code 

mark node dst as unreachable and don't advertise routes through it anymore. The cache will be updated only when necessary to avoid performing expensive traversals.