|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--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
| Nested 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. if it is this much bigger than the last link taken) |
static int |
LOCALOBJS
|
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." |
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()
|
|
| 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 final int LOCALOBJS
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 EventHandlerIFException
public void destroy()
throws Exception
destroy in interface EventHandlerIFExceptionpublic int profileSize()
profileSize in interface ProfilableIFprotected 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(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_tapestry_locate_msg(TapestryLocateMsg msg)
protected void handle_tapestry_locate_msg_cont(GetPtrResp gpr,
TapestryLocateMsg msg)
protected void handle_route_obj_root_msg(RouteObjRootMsg msg)
protected void handle_route_obj_root_msg_cont(GetPtrResp gpr,
RouteObjRootMsg msg)
public void handle_route_obj_dest_msg(RouteObjDestMsg msg)
public void handleEvent(QueueElementIF item)
throws EventHandlerException
handleEvent in interface EventHandlerIFEventHandlerException
protected void route_to_dest(SecureHash guid,
Object userData)
protected boolean route_to_dest_cont(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,
LinkedList l)
throws QSException
guid - The GUID of the object searched forhopInit - The # of hops taken to get here from the query source
QSException
public 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 EventHandlerIFEventHandlerExceptionpublic 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: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||