Constructor
Can be use to set message to NULL.Better not to skip defining the constructor.
Destructor
Clear/delete messages in destructor using cancelAndDelete(). New version seems to be motivating to use a destructor so better not to skip.
void initializeOverlay(int stage)
Can be used to initialize the overlay node, read parameter values, set key, set statistic collectors, start timers, etc.Can be use to set message to NULL.Better not to skip defining the constructor.
Destructor
Clear/delete messages in destructor using cancelAndDelete(). New version seems to be motivating to use a destructor so better not to skip.
void initializeOverlay(int stage)
- stage - can be either MIN_STAGE_APP (this module is being created) or MAX_STAGE_APP (all modules were created). We typically need MIN_STAGE_APP to initialize application functions & variables.
Called when module is terminating. Can be used to summarize stat. New OverSim version seems to be motivating us to delete messages in the destructor.
void joinOverlay()
Define what to do when a node is added to system. Can be used to establish connections with successor/predecessor & identify fingers in Chord. Also indicate to the simulator that overlay is now ready.
NodeVector* findNode(const OverlayKey& key, int numRedundantNodes, int numSiblings)
Is called by message forwarding function to determine potential next hops, e.g., finger node selection in Chord can go here. If asking node is a sibling (i.e., root) for the key, it will reply with list of siblings order according their closeness to the key.
- key - key to be located
- numRedundantNodes - Maximum number of next hop nodes to return
- numSibling - number of siblings (potential nodes that could store the key) to return
Am I the root, i.e.., node responsible for storing the given key?
- node - Nodehandler of the node method is suppose to be called
- key - key to be located
- numSibling - number of siblings (potential nodes that could store key) being requested
- err - return false if the range could not be determined
Get the maximum number of siblings (nodes close to a key) that are maintained by this overlay. Used by isSiblingFor()
Comments