|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcgl.narada.protocol.RoutingCache
public class RoutingCache
For a given node, this class maintains a cache of the links (from this node) that are the best links to send an event over to reach its destinations as computed by the profile info, and contained within the routing information that the event contains. The cache needs to be updated during link/node failures, since some if not all the entries could be invalidated by such an event. The cache would once again be updated during the node organization protocol. This class is implemented as a thread which waits on any updates on the gatewayInfo class, and upon receiving a notification recomputes the routing cache.
Field Summary |
---|
Constructor Summary | |
---|---|
RoutingCache(GatewayInfo gateway,
int systemLevel)
The routing cache constructor. |
Method Summary | |
---|---|
void |
addHop(Gateway hop)
This method adds a hop to the destination directory |
Gateway[] |
computeHopsToReachDestination(Destinations destinationToReach,
Destinations traversedSoFar)
|
Destinations |
destinationsReachedFromHop(Gateway gateway)
Provides the destinations that can be reached from a hop. |
Gateway |
getBestHopToReachNode(Gateway nodeToReach)
This method returns the best hop that needs to be taken to reach a given node |
Destinations |
getFastestDestinationsFromHop(Gateway hop)
Returns the destinations that can be reached fastest from the specified hop. |
Gateway[] |
hopsToReachDestination(Destinations destinationToReach,
Destinations traversedSoFar)
This method returns a list of hops that can be employed to reach our destinations. |
void |
invalidateDestinationDirectoryListings(int gatewayLevel)
If a new connection at level gatewayLevel is added, destination listings need to be computed for nodes at level >= gatewayLevel in the connectivity graph. |
static void |
main(String[] args)
|
void |
performDestinationDirectoryListing()
A utility method which traverses the destinationDirectory and provides a listing of the destinations at each level (within the connectivity graph) that can be reached by evry hop that originates from the vertex node |
void |
removeHop(Gateway hop)
This method removes a hop from the destination directory |
void |
updateRoutingInformation(Gateway nodeToReach,
Gateway bestHop)
This updates the routing cache with the best hop that needs to be taken to reach the node in question. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RoutingCache(GatewayInfo gateway, int systemLevel)
gateway
- -
The gatewayInfo for the server node.systemLevel
- -
The system levelMethod Detail |
---|
public void updateRoutingInformation(Gateway nodeToReach, Gateway bestHop)
nodeToReach
- -
The node that needs to be reachedbestHop
- -
The best hop that can be taken from the server node in
question to reach nodeToReachpublic Gateway getBestHopToReachNode(Gateway nodeToReach)
nodeToReach
- -
Is the (node+level) gateway node that needs to be reached in
the connectivity graph.public Destinations getFastestDestinationsFromHop(Gateway hop)
hop
-
public Gateway[] computeHopsToReachDestination(Destinations destinationToReach, Destinations traversedSoFar)
public Gateway[] hopsToReachDestination(Destinations destinationToReach, Destinations traversedSoFar)
destinationToReach
- The destinations that need to be reached.traversedSoFar
- The destinations that have been reached so far.
public Destinations destinationsReachedFromHop(Gateway gateway)
gateway
- -
The hop from the server node hosting the connectivity graph.
public void addHop(Gateway hop)
public void removeHop(Gateway hop)
public void invalidateDestinationDirectoryListings(int gatewayLevel)
gatewayLevel
- -
The destination level which needs to be invalidated.public void performDestinationDirectoryListing()
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |