OverSim
|
#include <TreeManagement.h>
Public Member Functions | |
TreeManagement () | |
void | init (NeighborCache *neighborCache) |
virtual | ~TreeManagement () |
void | handleTimerEvent (cMessage *msg) |
virtual bool | handleRpcCall (BaseCallMessage *msg) |
void | handleRpcTimeout (BaseCallMessage *msg, const TransportAddress &dest, cPolymorphic *context, int rpcId, const OverlayKey &destKey) |
This method is called if an RPC timeout has been reached. | |
bool | sendMessageToParent (BaseCallMessage *msg) |
send a message to the parent | |
bool | sendMessageToChildren (BaseCallMessage *msg) |
void | startTreeBuilding () |
const NodeHandle & | getParentNode () |
bool | isRoot () |
bool | isChild (TransportAddress &node) |
bool | isParent (TransportAddress &node) |
int | getCurrentTreeLevel () |
return the current tree level of this node | |
const treeNodeMap & | getChildNodes () |
void | addMsgClient (const char *identifier, AbstractTreeMsgClient *msgClient) |
void | removeMsgClient (const char *identifier) |
void | handleChildCheckRpcCall (ChildCheckCall *call) |
void | handleChildCheckRpcResponse (ChildCheckResponse *response, cPolymorphic *context, int rpcId, simtime_t rtt) |
void | finishTreeManagement () |
finish module and collect statistical data | |
Public Member Functions inherited from RpcListener | |
virtual | ~RpcListener () |
destructor |
Protected Member Functions | |
void | connectToParent () |
Check if a valid parent connection exists and establish one if not. | |
void | removeParentConnection () |
bool | checkParentValid () |
bool | registerAtParent () |
bool | isTreeDomainKeyValid () |
OverlayKey | getResponsibleDomainKey () |
Crawl the ID Space to find the smallest "Domain" for which the current node is NOT responsible. | |
void | handleParentRequestRpcCall (ParentRequestCall *msg) |
void | handleParentRequestRpcResponse (ParentRequestResponse *response, cPolymorphic *context, int rpcId, simtime_t rtt) |
void | handleChildReleaseRpcCall (ChildReleaseCall *msg) |
void | visualizeTreeLinkToNode (const NodeHandle &treeNode) |
void | addChildNode (NodeHandle &childNode) |
virtual void | handleRpcResponse (BaseResponseMessage *msg, cPolymorphic *context, int rpcId, simtime_t rtt) |
This method is called if an RPC response has been received. | |
void | sendChildReleaseCall () |
send a message to my parent to release me from his children-list | |
void | checkTreeChildNodes () |
check the lastTouch record of theChildNode map and send a ping if the time is over limit | |
void | removeTreeChild (const TransportAddress &childToRemove) |
remove child from list | |
void | debugChildren () |
void | cleanup () |
Protected Member Functions inherited from RpcListener | |
virtual void | handleRpcResponse (BaseResponseMessage *msg, const RpcState &rpcState, simtime_t rtt) |
This method is called if an RPC response has been received. | |
virtual void | handleRpcTimeout (const RpcState &rpcState) |
This method is called if an RPC timeout has been reached. |
Protected Attributes | |
int | currentTreeLevel |
Current TreeLevel of this node - calculated by getResponsibleDomainKey. | |
int | numTMSent [MAXTREELEVEL] |
int | numTMReceived [MAXTREELEVEL] |
int | bytesTMSent [MAXTREELEVEL] |
int | bytesTMReceived [MAXTREELEVEL] |
simtime_t | creationTime |
Private Types | |
typedef std::pair< const char *, AbstractTreeMsgClient * > | msgClientPair |
typedef UNORDERED_MAP< const char *, AbstractTreeMsgClient * > | msgClientMap |
Private Attributes | |
GlobalNodeList * | globalNodeList |
NeighborCache * | neighborCache |
BaseOverlay * | overlay |
NodeHandle | parentNode |
OverlayKey | treeDomainKey |
treeNodeMap | treeChildNodes |
cMessage * | treeBuildTimer |
double | treeMgmtBuildInterval |
double | deviation |
double | timeOutInSeconds |
msgClientMap | msgClients |
Definition at line 54 of file TreeManagement.h.
|
private |
Definition at line 77 of file TreeManagement.h.
|
private |
Definition at line 76 of file TreeManagement.h.
TreeManagement::TreeManagement | ( | ) |
Definition at line 38 of file TreeManagement.cc.
|
virtual |
Definition at line 46 of file TreeManagement.cc.
|
protected |
Definition at line 545 of file TreeManagement.cc.
Referenced by handleParentRequestRpcCall().
void TreeManagement::addMsgClient | ( | const char * | identifier, |
AbstractTreeMsgClient * | msgClient | ||
) |
Definition at line 705 of file TreeManagement.cc.
Referenced by NeighborCache::initializeApp().
|
protected |
Definition at line 332 of file TreeManagement.cc.
Referenced by connectToParent().
|
protected |
check the lastTouch record of theChildNode map and send a ping if the time is over limit
Definition at line 293 of file TreeManagement.cc.
Referenced by handleTimerEvent().
|
protected |
Definition at line 51 of file TreeManagement.cc.
Referenced by startTreeBuilding().
|
protected |
Check if a valid parent connection exists and establish one if not.
Definition at line 240 of file TreeManagement.cc.
Referenced by handleTimerEvent().
|
protected |
Definition at line 565 of file TreeManagement.cc.
Referenced by addChildNode().
void TreeManagement::finishTreeManagement | ( | ) |
finish module and collect statistical data
Definition at line 728 of file TreeManagement.cc.
Referenced by NeighborCache::finishApp().
const treeNodeMap & TreeManagement::getChildNodes | ( | ) |
Definition at line 699 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::cleanup(), and GlobalViewBuilder::handleCoordSendTimer().
int TreeManagement::getCurrentTreeLevel | ( | ) |
return the current tree level of this node
Definition at line 722 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::handleCoordSendTimer().
const NodeHandle & TreeManagement::getParentNode | ( | ) |
Definition at line 693 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::handleCoordinateRpcCall(), and GlobalViewBuilder::handleCoordSendTimer().
|
protected |
Crawl the ID Space to find the smallest "Domain" for which the current node is NOT responsible.
Definition at line 587 of file TreeManagement.cc.
Referenced by isTreeDomainKeyValid(), and registerAtParent().
void TreeManagement::handleChildCheckRpcCall | ( | ChildCheckCall * | call | ) |
Definition at line 459 of file TreeManagement.cc.
Referenced by handleRpcCall().
void TreeManagement::handleChildCheckRpcResponse | ( | ChildCheckResponse * | response, |
cPolymorphic * | context, | ||
int | rpcId, | ||
simtime_t | rtt | ||
) |
Definition at line 312 of file TreeManagement.cc.
Referenced by handleRpcResponse().
|
protected |
Definition at line 450 of file TreeManagement.cc.
Referenced by handleRpcCall().
|
protected |
Definition at line 484 of file TreeManagement.cc.
Referenced by handleRpcCall().
|
protected |
Definition at line 511 of file TreeManagement.cc.
Referenced by handleRpcResponse().
|
virtual |
Definition at line 97 of file TreeManagement.cc.
Referenced by NeighborCache::handleRpcCall().
|
protectedvirtual |
This method is called if an RPC response has been received.
msg | The response message. |
context | Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code |
rpcId | The RPC id. |
rtt | The Round-Trip-Time of this RPC |
Reimplemented from RpcListener.
Definition at line 114 of file TreeManagement.cc.
|
virtual |
This method is called if an RPC timeout has been reached.
msg | The original RPC message. |
dest | The destination node |
context | Pointer to an optional state object. The object has to be handled/deleted by the handleRpcResponse() code |
rpcId | The RPC id. |
destKey | the destination OverlayKey |
Reimplemented from RpcListener.
Definition at line 138 of file TreeManagement.cc.
void TreeManagement::handleTimerEvent | ( | cMessage * | msg | ) |
Definition at line 82 of file TreeManagement.cc.
Referenced by handleRpcTimeout(), NeighborCache::handleTimerEvent(), and startTreeBuilding().
void TreeManagement::init | ( | NeighborCache * | neighborCache | ) |
Definition at line 59 of file TreeManagement.cc.
Referenced by NeighborCache::initializeApp().
bool TreeManagement::isChild | ( | TransportAddress & | node | ) |
Definition at line 403 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::handleCoordinateRpcCall().
bool TreeManagement::isParent | ( | TransportAddress & | node | ) |
Definition at line 409 of file TreeManagement.cc.
bool TreeManagement::isRoot | ( | ) |
Definition at line 394 of file TreeManagement.cc.
Referenced by checkParentValid(), GlobalViewBuilder::handleCoordSendTimer(), and GlobalViewBuilder::handleTimerEvent().
|
protected |
Definition at line 382 of file TreeManagement.cc.
Referenced by checkParentValid().
|
protected |
Definition at line 423 of file TreeManagement.cc.
Referenced by connectToParent().
void TreeManagement::removeMsgClient | ( | const char * | identifier | ) |
Definition at line 714 of file TreeManagement.cc.
|
protected |
Definition at line 255 of file TreeManagement.cc.
Referenced by handleParentRequestRpcResponse().
|
protected |
remove child from list
NodeHandle | handle to childNode |
Definition at line 471 of file TreeManagement.cc.
Referenced by handleChildReleaseRpcCall().
|
protected |
send a message to my parent to release me from his children-list
Definition at line 272 of file TreeManagement.cc.
Referenced by removeParentConnection().
bool TreeManagement::sendMessageToChildren | ( | BaseCallMessage * | msg | ) |
Definition at line 662 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::handleCoordinateRpcCall(), and GlobalViewBuilder::spreadGlobalView().
bool TreeManagement::sendMessageToParent | ( | BaseCallMessage * | msg | ) |
send a message to the parent
msg | BaseCallMessage |
Definition at line 634 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::handleCoordSendTimer().
void TreeManagement::startTreeBuilding | ( | ) |
Definition at line 416 of file TreeManagement.cc.
Referenced by GlobalViewBuilder::handleCoordSendTimer(), and NeighborCache::handleReadyMessage().
|
protected |
|
protected |
Definition at line 175 of file TreeManagement.h.
Referenced by finishTreeManagement(), handleRpcCall(), handleRpcResponse(), and init().
|
protected |
Definition at line 174 of file TreeManagement.h.
Referenced by finishTreeManagement(), init(), registerAtParent(), sendChildReleaseCall(), sendMessageToChildren(), and sendMessageToParent().
|
protected |
Definition at line 177 of file TreeManagement.h.
Referenced by finishTreeManagement(), and init().
|
protected |
Current TreeLevel of this node - calculated by getResponsibleDomainKey.
Definition at line 170 of file TreeManagement.h.
Referenced by getCurrentTreeLevel(), getResponsibleDomainKey(), handleRpcCall(), handleRpcResponse(), registerAtParent(), sendChildReleaseCall(), sendMessageToChildren(), sendMessageToParent(), and TreeManagement().
|
private |
Definition at line 70 of file TreeManagement.h.
Referenced by handleTimerEvent(), and init().
|
private |
Definition at line 59 of file TreeManagement.h.
Referenced by init(), and TreeManagement().
|
private |
Definition at line 79 of file TreeManagement.h.
Referenced by addChildNode(), addMsgClient(), handleParentRequestRpcResponse(), and removeMsgClient().
|
private |
Definition at line 60 of file TreeManagement.h.
Referenced by checkParentValid(), checkTreeChildNodes(), finishTreeManagement(), handleChildCheckRpcCall(), handleParentRequestRpcCall(), handleParentRequestRpcResponse(), handleRpcCall(), handleRpcResponse(), handleRpcTimeout(), handleTimerEvent(), init(), registerAtParent(), sendChildReleaseCall(), sendMessageToChildren(), sendMessageToParent(), and ~TreeManagement().
|
protected |
Definition at line 173 of file TreeManagement.h.
Referenced by finishTreeManagement(), handleRpcCall(), handleRpcResponse(), and init().
|
protected |
Definition at line 172 of file TreeManagement.h.
Referenced by finishTreeManagement(), init(), registerAtParent(), sendChildReleaseCall(), sendMessageToChildren(), and sendMessageToParent().
|
private |
Definition at line 61 of file TreeManagement.h.
Referenced by addChildNode(), checkParentValid(), connectToParent(), debugChildren(), getResponsibleDomainKey(), handleParentRequestRpcCall(), handleParentRequestRpcResponse(), handleRpcTimeout(), init(), isRoot(), and removeParentConnection().
|
private |
Definition at line 62 of file TreeManagement.h.
Referenced by checkParentValid(), cleanup(), getParentNode(), handleChildCheckRpcCall(), handleParentRequestRpcResponse(), handleRpcTimeout(), isParent(), isRoot(), removeParentConnection(), sendChildReleaseCall(), and sendMessageToParent().
|
private |
Definition at line 71 of file TreeManagement.h.
Referenced by checkTreeChildNodes(), and init().
|
private |
Definition at line 67 of file TreeManagement.h.
Referenced by handleRpcTimeout(), handleTimerEvent(), startTreeBuilding(), TreeManagement(), and ~TreeManagement().
|
private |
Definition at line 65 of file TreeManagement.h.
Referenced by addChildNode(), checkTreeChildNodes(), cleanup(), debugChildren(), getChildNodes(), handleChildCheckRpcResponse(), handleRpcTimeout(), isChild(), removeTreeChild(), and sendMessageToChildren().
|
private |
Definition at line 63 of file TreeManagement.h.
Referenced by checkParentValid(), cleanup(), handleRpcTimeout(), isTreeDomainKeyValid(), registerAtParent(), and TreeManagement().
|
private |
Definition at line 69 of file TreeManagement.h.
Referenced by handleTimerEvent(), and init().