|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ostore.tapestry.impl.Router
Handles the routing functions of Tapestry. TODO: The back pointers are currently maintained in sorted linked lists which are sorted by distance. All the elements in a list have the same guid, and the lists are stored in a map indexed by those guids. I don't have to tell you that this is inefficient, but I can't get Java's TreeSet class to replace the lists. I think it has something to do with what the Javadocs call compare being "compatible with" equals. I don't know. In any case, the backpointers will need to be stored on disk at some point, not all in memory, so this will all need an overhauling then. --srhea, 12/18/2001
Inner Class Summary | |
class |
Router.MsgTime
A Comparator used to compare the enqueue time
for message in multicast queue. |
static class |
Router.ObjectMap
|
Field Summary | |
static byte[] |
_match_bytes
|
static boolean |
FRLS
Boolean flag that turns FRLS mode on or off. |
static int |
LOCAL_OPT_BACKUPS
The default number of backups to publish to while optimizing |
static int |
LOCAL_OPT_HOPS
The default initial time-to-live for the local optimizations that only get forwarded for a few hops. |
static int |
LOCAL_OPT_NEAREST
The default number of links on the same level to publish to while optimizing |
static int |
LOCAL_OPT_PUBLISH_ALL_LINKS
|
static int |
LOCAL_OPT_PUBLISH_BACKUP
The following flags represent flags for local optimizations during publishing. |
static int |
LOCAL_OPT_PUBLISH_LOCAL_MISROUTE
|
static int |
LOCAL_OPT_THRESHOLD_FACTOR
The factor by which to judge whether or not a link is too long to take (i.e. |
static int |
LOCALROOTOBJS
|
static boolean |
MULTICAST
The constant that defines whether multicast is turned on or not. |
static int |
MULTICAST_QUEUE_SIZE
The size of the multicast convergence queue, which we use to drop duplicate messages which are produced by the multicast routing mechanism. |
static int |
THRESHOLD_DEAD
Threshold for determining when a node is "dead." If a node's updated link loss rate is rated above THRESHOLD_DEAD for this current period, then it is "dead." Config name = inactive_node_threshold |
static int |
THRESHOLD_FRLS
The maximum failure rate tolerable that defines "reachable" in our FRLS scheme. |
static int |
THRESHOLD_MULTICAST
The constant that defines when multicast is triggered for a message. |
static int |
THRESHOLD_REPLACE
If a node has been "dead/inactive" for a consecutive number of periods equal or greater than THRESHOLD_REPLACE, it is removed from the routing table and we try to replace it using repair algorithms. |
Constructor Summary | |
Router()
|
Method Summary | |
static void |
BUG(String msg)
|
void |
destroy()
|
static void |
dumpRevpointers(HashMap revs,
int level)
|
ChannelHandler |
get_channel_handler()
|
RoutingTable |
get_routing_table()
|
SecureHash |
get_self_guid()
|
NodeId |
get_self_node_id()
|
SinkIF |
get_sink()
|
static Set |
getRevpointers(Map revs,
int level)
|
static int |
guidCompare(SecureHash one,
SecureHash two)
Compare two guids and return the index (starting with 0) of the first differing digit. |
protected void |
handle_bloom_wrapper(BloomWrapper wrapper)
|
protected void |
handle_icmp_ping_msg(ostore.tapestry.channel.ICMPPingMsg msg)
|
protected void |
handle_publish_msg(PublishMsg msg)
|
protected void |
handle_republish_request(RepublishRequestMsg msg)
|
protected void |
handle_route_msg(RouteMsg msg)
|
void |
handle_route_obj_dest_msg(RouteObjDestMsg msg)
|
protected void |
handle_route_obj_root_msg(RouteObjRootMsg msg)
|
protected void |
handle_stages_init_signal()
For use in derived classes. |
protected void |
handle_tapestry_locate_msg(TapestryLocateMsg msg)
|
protected void |
handle_tapestry_prefix_route_msg(TapestryPrefixRouteMsg msg)
|
protected void |
handle_tapestry_publish_msg(TapestryPublishMsg msg)
|
protected void |
handle_tapestry_route_msg(TapestryRouteMsg msg)
|
protected void |
handle_tapestry_unpublish_msg(TapestryUnpublishMsg msg)
|
void |
handleEvent(QueueElementIF item)
|
void |
handleEvents(QueueElementIF[] items)
|
void |
init(ConfigDataIF config)
|
boolean |
isDuplicate(QueueElementIF item)
|
int |
profileSize()
|
protected void |
publish(SecureHash src,
SecureHash guid,
TapestryTag ttag,
boolean publish,
NodeId lasthop,
int qos)
|
protected void |
publish(SecureHash src,
SecureHash guid,
TapestryTag ttag,
boolean publish,
NodeId lasthop,
int qos,
int local_opts,
int local_opts_ttl)
|
protected boolean |
route_to_dest(SecureHash guid,
SecureHash src,
TapestryQuery query,
TapestryQueryState state,
QuickSerializable user_data,
int user_data_length,
InputBuffer user_data_buffer,
int hopInit,
int TTL,
int qos)
Method to check local pointers for an object, and if found, sends RouteObjDest messages to the actual locations of the objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LOCALROOTOBJS
public static boolean MULTICAST
public static int THRESHOLD_MULTICAST
public static int MULTICAST_QUEUE_SIZE
public static boolean FRLS
public static int THRESHOLD_FRLS
public static int THRESHOLD_DEAD
public static int THRESHOLD_REPLACE
public static final byte[] _match_bytes
public static final int LOCAL_OPT_PUBLISH_BACKUP
public static final int LOCAL_OPT_PUBLISH_ALL_LINKS
public static final int LOCAL_OPT_PUBLISH_LOCAL_MISROUTE
public static int LOCAL_OPT_BACKUPS
public static int LOCAL_OPT_NEAREST
public static int LOCAL_OPT_THRESHOLD_FACTOR
public static int LOCAL_OPT_HOPS
Constructor Detail |
public Router()
Method Detail |
public boolean isDuplicate(QueueElementIF item)
public static final void BUG(String msg)
public void init(ConfigDataIF config) throws Exception
init
in interface EventHandlerIF
public void destroy() throws Exception
destroy
in interface EventHandlerIF
public int profileSize()
profileSize
in interface ProfilableIF
protected void handle_stages_init_signal()
public static void dumpRevpointers(HashMap revs, int level)
public static Set getRevpointers(Map revs, int level)
protected void handle_icmp_ping_msg(ostore.tapestry.channel.ICMPPingMsg msg)
protected void handle_tapestry_route_msg(TapestryRouteMsg msg)
protected void handle_tapestry_prefix_route_msg(TapestryPrefixRouteMsg msg)
protected void handle_route_msg(RouteMsg msg)
protected void handle_tapestry_publish_msg(TapestryPublishMsg msg)
protected void handle_tapestry_unpublish_msg(TapestryUnpublishMsg msg)
protected void handle_republish_request(RepublishRequestMsg msg)
protected void handle_publish_msg(PublishMsg msg)
protected void handle_bloom_wrapper(BloomWrapper wrapper)
protected void handle_tapestry_locate_msg(TapestryLocateMsg msg)
protected void handle_route_obj_root_msg(RouteObjRootMsg msg)
public void handle_route_obj_dest_msg(RouteObjDestMsg msg)
public void handleEvent(QueueElementIF item) throws EventHandlerException
handleEvent
in interface EventHandlerIF
protected boolean route_to_dest(SecureHash guid, SecureHash src, TapestryQuery query, TapestryQueryState state, QuickSerializable user_data, int user_data_length, InputBuffer user_data_buffer, int hopInit, int TTL, int qos) throws QSException
guid
- The GUID of the object searched forhopInit
- The # of hops taken to get here from the query sourcepublic static int guidCompare(SecureHash one, SecureHash two)
protected void publish(SecureHash src, SecureHash guid, TapestryTag ttag, boolean publish, NodeId lasthop, int qos)
protected void publish(SecureHash src, SecureHash guid, TapestryTag ttag, boolean publish, NodeId lasthop, int qos, int local_opts, int local_opts_ttl)
public void handleEvents(QueueElementIF[] items) throws EventHandlerException
handleEvents
in interface EventHandlerIF
public NodeId get_self_node_id()
public SecureHash get_self_guid()
public SinkIF get_sink()
public ChannelHandler get_channel_handler()
public RoutingTable get_routing_table()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |