forest-net
an overlay networks for large-scale virtual worlds
|
Maintains information about the comtrees in a Forest network. More...
#include <ComtInfo.h>
Classes | |
struct | ComtLeafInfo |
struct | ComtreeInfo |
struct | ComtRtrInfo |
Public Member Functions | |
ComtInfo (int, NetInfo &) | |
Constructor for ComtInfo, allocates space and initializes private data. More... | |
~ComtInfo () | |
Destructor for ComtInfo class. More... | |
bool | init () |
Initialize locks and condition variables. More... | |
bool | validComtree (int) const |
Check to see if a given comtree number is valid. More... | |
bool | validComtIndex (int) const |
Check to see if a given comtree index is valid. More... | |
bool | isComtNode (int, int) const |
Determine if a node belongs to a comtree or not. More... | |
bool | isComtRtr (int, int) const |
Determine if a node is a router in a comtree or not. More... | |
bool | isComtLeaf (int, int) const |
Determine if a node is a leaf in a comtree. More... | |
bool | isCoreNode (int, fAdr_t) const |
Determine if a router is a core node in a specified comtree. More... | |
bool | isComtLink (int, int) const |
Determine if a link is in a specified comtree. More... | |
int | firstComtree () |
Get the first comtree in the list of valid comtrees and lock it. More... | |
int | nextComtree (int) |
Get the next comtree in the list of valid comtrees and lock it. More... | |
fAdr_t | firstCore (int) const |
Get the forest address of the first core node in a comtree. More... | |
fAdr_t | nextCore (int, fAdr_t) const |
Get the forest address of the next core node in a comtree. More... | |
fAdr_t | firstRouter (int) const |
Get the forest address of the first router in a comtree. More... | |
fAdr_t | nextRouter (int, fAdr_t) const |
Get the forest address of the next router in a comtree. More... | |
fAdr_t | firstLeaf (int) const |
Get the forest address of the first leaf in a comtree. More... | |
fAdr_t | nextLeaf (int, fAdr_t) const |
Get the forest address of the next leaf in a comtree. More... | |
int | getComtIndex (int) |
Get the comtree index for a given comtree and lock the comtree. More... | |
int | getComtree (int) const |
Get the comtree number for the comtree with a given index. More... | |
fAdr_t | getOwner (int) const |
Get the owner of a comtree with specified index. More... | |
fAdr_t | getRoot (int) const |
Get the comtree root for the comtree with a given index. More... | |
bool | getConfigMode (int) const |
get the backbone configuration mode of a comtree. More... | |
RateSpec & | getDefLeafRates (int) |
Get the default RateSpecs for access links in a comtree. More... | |
RateSpec & | getDefBbRates (int) |
Get the default RateSpecs for backbone links in a comtree. More... | |
fAdr_t | getChild (int, int) const |
Get the child endpoint of a link in a comtree. More... | |
int | getPlink (int, fAdr_t) const |
Get the link to a parent of a node in a comtree. More... | |
fAdr_t | getParent (int, fAdr_t) const |
Get the parent of a comtree node. More... | |
int | getLinkCnt (int, fAdr_t) const |
Get the number of links in a comtree that are incident to a router. More... | |
bool | isFrozen (int, fAdr_t) const |
Determine if the rates for a comtree backbone link are frozen. More... | |
RateSpec & | getLinkRates (int, int) const |
Get the RateSpec for a comtree link. More... | |
int | addComtree (int) |
Add a new comtree. More... | |
bool | removeComtree (int) |
Remove a comtree. More... | |
bool | setRoot (int, fAdr_t) |
Set the root node of a comtree. More... | |
bool | setOwner (int, fAdr_t) |
Set the owner of a comtree. More... | |
void | setConfigMode (int, bool) |
Set the backbone configuration mode of a comtree. More... | |
bool | addNode (int, fAdr_t) |
Add a new node to a comtree. More... | |
bool | removeNode (int, fAdr_t) |
Remove a node from a comtree. More... | |
bool | addCoreNode (int, fAdr_t) |
Set the default RateSpecs for a comtree. More... | |
bool | removeCoreNode (int, fAdr_t) |
Remove a core node from a comtree. More... | |
bool | setPlink (int, fAdr_t, int) |
Set the parent link of a router in the comtree. More... | |
bool | setParent (int, fAdr_t, fAdr_t, int) |
Set the parent of a leaf in the comtree. More... | |
void | freeze (int, fAdr_t) |
Freeze the rate of a comtree link. More... | |
void | thaw (int, fAdr_t) |
Thaw (unfreeze) the rate of a comtree link. More... | |
bool | setAllComtRates () |
Set rates for links in all comtrees. More... | |
bool | setComtRates (int) |
Compute rates for all links in a comtree and allocate capacity of network links. More... | |
void | setAutoConfigRates (int) |
Set the backbone link capacities for an auto-configured comtree. More... | |
bool | checkComtRates (int) |
Check that there is sufficient capacity available for all links in a comtree. More... | |
int | findPath (int, int, RateSpec &, list< LinkMod > &) |
Find a path from a vertex to a comtree. More... | |
bool | findRootPath (int, int, RateSpec &, vector< int > &) |
Find a path from a vertex to the root of a comtree. More... | |
void | addPath (int, list< LinkMod > &) |
Add a path from a router to a comtree. More... | |
void | removePath (int, list< LinkMod > &) |
Remove a path from a router in a comtree. More... | |
bool | adjustSubtreeRates (int, int, RateSpec &) |
Adjust the subtree rates along path to root. More... | |
bool | computeMods (int, list< LinkMod > &) |
Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available. More... | |
bool | computeMods (int, fAdr_t, RateSpec &, list< LinkMod > &) |
Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available. More... | |
void | provision (int) |
Provision all links in a comtree, reducing available link capacity. More... | |
void | provision (int, list< LinkMod > &) |
Add to the capacity of a list of comtree backbone links and provision required link capacity in the network. More... | |
void | unprovision (int) |
Unprovision all links in a comtree,increasing available link capacity. More... | |
void | unprovision (int, list< LinkMod > &) |
Reduce the capacity of a list of comtree links and release required link capacity in the network. More... | |
bool | read (istream &) |
Read comtrees from an input stream. More... | |
comt_t | readComtree (istream &, string &) |
Read a comtree description from an input stream. More... | |
bool | readRateSpec (istream &, RateSpec &) |
Read a rate specification. More... | |
bool | readLink (istream &, int &, RateSpec &, int &, string &) |
Read a link description from an input stream. More... | |
bool | readLinkEndpoint (istream &, string &, int &) |
Read a link endpoint. More... | |
string & | link2string (int, int, string &) const |
Create a string representation of a comtree link, including RateSpec. More... | |
string & | leafLink2string (int, fAdr_t, string &) const |
Create a string representation of a parent link for a leaf. More... | |
string & | comt2string (int, string &) const |
Create a string representation of a comtree. More... | |
string & | comtStatus2string (int, string &) const |
Create a string representation of a the status of a comtree. More... | |
string & | comtStatus22string (int, string &) const |
string & | toString (string &) |
Create a string representation of the ComtInfo object. More... | |
bool | check () |
Perform consistency check on all comtrees. More... | |
bool | checkLinkCounts (int) |
bool | checkSubtreeRates (int) |
bool | checkLinkRates (int) |
void | releaseComtree (int) |
Release a previously locked comtree. More... | |
void | lockMap () |
Lock the data structure. More... | |
void | unlockMap () |
Private Attributes | |
int | maxComtree |
maximum number of comtrees | |
NetInfo * | net |
NetInfo data structure for network. | |
ComtreeInfo * | comtree |
array of comtrees | |
IdMap * | comtreeMap |
maps comtree numbers to indices in array | |
pthread_mutex_t | mapLock |
locks comtreeMap | |
Maintains information about the comtrees in a Forest network.
Definition at line 33 of file ComtInfo.h.
forest::ComtInfo::ComtInfo | ( | int | maxComtree1, |
NetInfo & | net1 | ||
) |
Constructor for ComtInfo, allocates space and initializes private data.
maxNode1 | is the maximum number of nodes in this ComtInfo object |
maxLink1 | is the maximum number of links in this ComtInfo object |
maxRtr1 | is the maximum number of routers in this ComtInfo object |
maxCtl1 | is the maximum number of controllers in this ComtInfo object |
maxComtree1 | is the maximum number of comtrees in this ComtInfo object |
Definition at line 20 of file ComtInfo.cpp.
forest::ComtInfo::~ComtInfo | ( | ) |
Destructor for ComtInfo class.
Deallocates all dynamic storage
Definition at line 29 of file ComtInfo.cpp.
int forest::ComtInfo::addComtree | ( | int | comt) |
Add a new comtree.
Defines a new comtree, with attributes left undefined.
comt | is the comtree number for the new comtree. |
Definition at line 146 of file ComtInfo.cpp.
|
inline |
Set the default RateSpecs for a comtree.
ctx | is a valid comtree index |
bbRates | is a reference to a RateSpec for the new backbone rates |
leafRates | is a reference to a RateSpec for the new leaf rates inline void ComtInfo::setDefRates(int ctx, RateSpec& bbRates, RateSpec& leafRates) { comtree[ctx].bbDefRates = bbRates; comtree[ctx].leafDefRates = leafRates; }Add a new core node to a comtree. The new node is required to be a router and if it is not already in the comtree, it is added. |
ctx | is the comtree index |
r | is the forest address of the router |
Definition at line 519 of file ComtInfo.h.
bool forest::ComtInfo::addNode | ( | int | ctx, |
fAdr_t | fa | ||
) |
Add a new node to a comtree.
ctx | is the comtree index |
fa | is a valid forest address |
Definition at line 188 of file ComtInfo.cpp.
void forest::ComtInfo::addPath | ( | int | ctx, |
list< LinkMod > & | path | ||
) |
Add a path from a router to a comtree.
This method adds a list of links to the backbone of an existing comtree, sets their link rates and reserves capacity on the network links; the links are assumed to have sufficient available capacity. Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index for the comtree of interest |
path | is a reference to a list of LinkMod objects defining a path in the comtree; the links appear in "bottom-up" order leading from some router outside the comtree to a router in the comtree |
Definition at line 1200 of file ComtInfo.cpp.
bool forest::ComtInfo::adjustSubtreeRates | ( | int | , |
int | , | ||
RateSpec & | |||
) |
Adjust the subtree rates along path to root.
Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index |
rtr | is the forest address of a router in the comtree |
rs | is a RateSpec that is to be added to the subtree rates at all vertices from rtr to the root |
return | true on success, false on failure |
Definition at line 259 of file ComtInfo.cpp.
bool forest::ComtInfo::check | ( | ) |
Perform consistency check on all comtrees.
Definition at line 617 of file ComtInfo.cpp.
bool forest::ComtInfo::checkComtRates | ( | int | ctx) |
Check that there is sufficient capacity available for all links in a comtree.
Requires that rates have been set for all comtree links. Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index |
Definition at line 944 of file ComtInfo.cpp.
bool forest::ComtInfo::computeMods | ( | int | ctx, |
list< LinkMod > & | modList | ||
) |
Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available.
Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is the comtree index of the comtree |
modList | is a list of edges in the comtree and RateSpecs representing the change in rates required at each link in the list; returned RateSpecs may have negative values; list should be empty in top level recursive call |
Definition at line 1250 of file ComtInfo.cpp.
bool forest::ComtInfo::computeMods | ( | int | ctx, |
fAdr_t | radr, | ||
RateSpec & | rootRates, | ||
list< LinkMod > & | modList | ||
) |
Compute the change required in the RateSpecs for links in an auto-configured comtree and verify that needed capacity is available.
This is a recursive helper method called from the top-level computeMods method. Assumes that current thread holds a lock on comtree, and a lock on the network object.
ctx | is the comtree index of the comtree |
radr | is the Forest address of the root of the current subtree; should be the comtree root in the top level recursive call |
modList | is a list of edges in the comtree and RateSpecs representing the change in rates required at each link in the list; returned RateSpecs may have negative values; list should be empty in top level recursive call |
Definition at line 1275 of file ComtInfo.cpp.
string & forest::ComtInfo::comt2string | ( | int | ctx, |
string & | s | ||
) | const |
Create a string representation of a comtree.
Does not do any locking, so may produce inconsistent results in multi-threaded environment.
ctx | is the comtree index for a comtree |
s | is a reference to a string in which result is returned |
Definition at line 1442 of file ComtInfo.cpp.
string & forest::ComtInfo::comtStatus2string | ( | int | ctx, |
string & | s | ||
) | const |
Create a string representation of a the status of a comtree.
Shows only the backbone links, but includes link counts for all routers. Does not do any locking, so may produce inconsistent results in multi-threaded environment.
ctx | is the comtree index for a comtree |
s | is a reference to a string in which result is returned |
Definition at line 1508 of file ComtInfo.cpp.
Find a path from a vertex to a comtree.
This method builds a shortest path tree with a given source node. The search is done over all network links that have the available capacity to handle a provided RateSpec. The search halts when it reaches any node in the comtree. The path from source to this node is returned in path. Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index for the comtree of interest |
src | is the router at which the path search starts |
rs | specifies the rates required on the links in the path |
path | is a reference to a list of LinkMod objects which define the path when the method returns; the links are ordered "bottom-up:. @return the router number of the "branchRouter" at which the path ends, or 0 if no path is found |
Definition at line 1047 of file ComtInfo.cpp.
bool forest::ComtInfo::findRootPath | ( | int | ctx, |
int | src, | ||
RateSpec & | rs, | ||
vector< int > & | path | ||
) |
Find a path from a vertex to the root of a comtree.
This method builds a shortest path tree with a given source node. The search is done over all network links that have the available capacity to handle a specified RateSpec. The search halts when it reaches any node in the comtree, then follows the path to the root. This method is not ideal, since it can return paths that do not provide for future growth. It is also not necessarily the best path from a cost standpoint. Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index for the comtree of interest |
src | is the router at which the path search starts |
rs | specifies the rates required on the links in the path |
path | is an integer vector in which the result returned; Values are router local link numbers that define the path in a bottom-up fashion. |
Definition at line 1114 of file ComtInfo.cpp.
int forest::ComtInfo::firstComtree | ( | ) |
Get the first comtree in the list of valid comtrees and lock it.
Definition at line 90 of file ComtInfo.cpp.
|
inline |
Get the forest address of the first core node in a comtree.
ctx | is a valid comtree index |
Definition at line 262 of file ComtInfo.h.
|
inline |
Get the forest address of the first leaf in a comtree.
ctx | is a valid comtree index |
Definition at line 306 of file ComtInfo.h.
|
inline |
Get the forest address of the first router in a comtree.
ctx | is a valid comtree index |
Definition at line 284 of file ComtInfo.h.
|
inline |
Freeze the rate of a comtree link.
ctx | is a valid comtree index |
rtr | is a forest address for a router in the comtree; this method freezes the rate of the parent link at rtr |
Definition at line 595 of file ComtInfo.h.
|
inline |
Get the child endpoint of a link in a comtree.
ctx | is a valid comtree index |
lnk | is a link number for a link in the comtree |
Definition at line 390 of file ComtInfo.h.
int forest::ComtInfo::getComtIndex | ( | int | comt) |
Get the comtree index for a given comtree and lock the comtree.
is | a comtree number (not an index) |
Definition at line 58 of file ComtInfo.cpp.
|
inline |
Get the comtree number for the comtree with a given index.
ctx | is a valid comtree index |
return | the comtree number that is mapped to index c or 0 if c is not a valid index |
Definition at line 328 of file ComtInfo.h.
|
inline |
get the backbone configuration mode of a comtree.
ctx | is the index of the comtree |
Definition at line 486 of file ComtInfo.h.
|
inline |
Get the default RateSpecs for backbone links in a comtree.
ctx | is a valid comtree index |
Definition at line 426 of file ComtInfo.h.
|
inline |
Get the default RateSpecs for access links in a comtree.
ctx | is a valid comtree index |
Definition at line 418 of file ComtInfo.h.
|
inline |
Get the number of links in a comtree that are incident to a router.
ctx | is a valid comtree index |
rtr | is the number of a router in the comtree |
Definition at line 408 of file ComtInfo.h.
|
inline |
Get the RateSpec for a comtree link.
The rates represent the amount of network capacity required for this link, given the subtree rates and the backbone configuration mode.
ctx | is a valid comtree index |
fa | is a forest address for a node in the comtree |
Definition at line 451 of file ComtInfo.h.
|
inline |
Get the owner of a comtree with specified index.
ctx | is a valid comtree index |
return | the forest address of the client that originally created the comtree, or 0 if c is not a valid index |
Definition at line 346 of file ComtInfo.h.
Get the parent of a comtree node.
ctx | is a valid comtree index |
fa | is the number of a node in the comtree |
Definition at line 372 of file ComtInfo.h.
|
inline |
Get the link to a parent of a node in a comtree.
ctx | is a valid comtree index |
nfa | is a forest address of a node in the comtree |
Definition at line 357 of file ComtInfo.h.
|
inline |
Get the comtree root for the comtree with a given index.
ctx | is a valid comtree index |
return | the specified root node for the comtree or 0 if c is not a valid index |
Definition at line 337 of file ComtInfo.h.
bool forest::ComtInfo::init | ( | ) |
Initialize locks and condition variables.
Definition at line 42 of file ComtInfo.cpp.
|
inline |
Determine if a node is a leaf in a comtree.
ctx | is the comtree index of the comtree of interest |
ln | is the forest address of a network node |
Definition at line 239 of file ComtInfo.h.
|
inline |
Determine if a link is in a specified comtree.
ctx | is a valid comtree index |
lnk | is a link number |
Definition at line 249 of file ComtInfo.h.
|
inline |
Determine if a node belongs to a comtree or not.
ctx | is the comtree index of the comtree of interest |
fa | is the forest address of a node that is to be checked for membership in the comtree |
Definition at line 220 of file ComtInfo.h.
|
inline |
Determine if a node is a router in a comtree or not.
ctx | is the comtree index of the comtree of interest |
fa | is the forest address of the node that we want to check in the comtree |
Definition at line 230 of file ComtInfo.h.
|
inline |
Determine if a router is a core node in a specified comtree.
ctx | is a valid comtree index |
r | is the forest address of a router |
Definition at line 210 of file ComtInfo.h.
|
inline |
Determine if the rates for a comtree backbone link are frozen.
ctx | is a valid comtree index |
rtr | is a forest address for a node in the comtree |
Definition at line 436 of file ComtInfo.h.
string & forest::ComtInfo::leafLink2string | ( | int | ctx, |
fAdr_t | leafAdr, | ||
string & | s | ||
) | const |
Create a string representation of a parent link for a leaf.
Does not do any locking, so may produce inconsistent results in multi-threaded environment.
ctx | is the comtree index for a comtree |
leafAdr | is a forest address of a leaf node |
s | is a reference to a string in which result is returned |
Definition at line 1420 of file ComtInfo.cpp.
string & forest::ComtInfo::link2string | ( | int | ctx, |
int | lnk, | ||
string & | s | ||
) | const |
Create a string representation of a comtree link, including RateSpec.
Does not do any locking, so may produce inconsistent results in multi-threaded environment.
ctx | is the comtree index for a comtree |
lnk | is a link number for a link in the comtree |
s | is a reference to a string in which result is returned |
Definition at line 1386 of file ComtInfo.cpp.
|
inline |
Lock the data structure.
More precisely, locks the map from comtrees to comtree index values. The map must be locked when looking up the comtree index and when adding/removing comtrees. This locking is done as needed by other methods. Applications should generally avoid using these methods directly, as uninformed use can cause deadlock.
Definition at line 619 of file ComtInfo.h.
int forest::ComtInfo::nextComtree | ( | int | ctx) |
Get the next comtree in the list of valid comtrees and lock it.
ctx | is the index of a valid comtree |
Definition at line 113 of file ComtInfo.cpp.
|
inline |
Get the forest address of the next core node in a comtree.
ctx | is the comtree index |
rtr | is the forest address of a core node in the comtree |
Definition at line 273 of file ComtInfo.h.
|
inline |
Get the forest address of the next leaf in a comtree.
ctx | is a valid comtree index |
leaf | is the forest address of a leaf in the comtree |
Definition at line 317 of file ComtInfo.h.
|
inline |
Get the forest address of the next router in a comtree.
ctx | is a valid comtree index |
rtr | is the forest address of a router in the comtree |
Definition at line 295 of file ComtInfo.h.
void forest::ComtInfo::provision | ( | int | ctx) |
Provision all links in a comtree, reducing available link capacity.
Assumes that the required network capacity is available and that comtree links are configured with required rates. Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index |
Definition at line 979 of file ComtInfo.cpp.
void forest::ComtInfo::provision | ( | int | ctx, |
list< LinkMod > & | modList | ||
) |
Add to the capacity of a list of comtree backbone links and provision required link capacity in the network.
Assumes that network links have the required capacity and that both endpoints of each link are routers. Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is the index of a comptree |
modList | is a list of link modifications; that is, comtree links that are either to be added or have their rate adjusted. and a RateSpec difference to be added to that link. |
Definition at line 1326 of file ComtInfo.cpp.
bool forest::ComtInfo::read | ( | istream & | in) |
Read comtrees from an input stream.
Comtree file contains one of more comtree definitions, where a comtree definition is as shown below
comtree(1001, netMgr, r1, manual, (1000,2000,1000,2000),(10,50,25,200), (r1,r2,r3), # core nodes (r1.1,r2.2,(1000,2000,1000,2000)), (r1.2,r3.3,(1000,2000,1000,2000)) ) ; # required after last comtree
The list of core nodes and the list of links may both be omitted. To omit the list of core nodes, while providing the list of links, use a pair of commas after the leaf default rates. In the list of links, the first named node is assumed to be the child of the other node in the comtree. The RateSpec may be omitted, but if provided, the first number is the upstream bit rate, followed by downstream bit rate, upstream packet rate and downstream packet rate.
This method assumes that no other thread currently has access to the ComtInfo object. It should only be used on startup, before other threads are launched.
Definition at line 303 of file ComtInfo.cpp.
comt_t forest::ComtInfo::readComtree | ( | istream & | in, |
string & | errMsg | ||
) |
Read a comtree description from an input stream.
Expects the next nonblank input character to be the opening parenthesis of the comtree description. If a new comtree is read without error, proceeds to allocate and initialize the new comtree. This thread is assumed to be the only one with access to the ComtInfo object at the moment. The method should only be used on startup, before other threads are launched.
in | is an open input stream |
errMsg | is a reference to a string used for returning an error message |
Definition at line 344 of file ComtInfo.cpp.
bool forest::ComtInfo::readLink | ( | istream & | in, |
int & | lnk, | ||
RateSpec & | rs, | ||
int & | child, | ||
string & | errMsg | ||
) |
Read a link description from an input stream.
Expects the next nonblank input character to be the opening parenthesis.
in | is an open input stream |
lnk | is used to return the link number for the link |
rs | is used to return the RateSpec for this link |
child | is used to return the "child" endpoint of the link |
errMsg | is a reference to a string used for returning an error message |
Definition at line 546 of file ComtInfo.cpp.
bool forest::ComtInfo::readLinkEndpoint | ( | istream & | in, |
string & | name, | ||
int & | num | ||
) |
Read a link endpoint.
in | is an open input stream |
name | is a reference to a string used to return the endpoint name |
num | is a reference to an int used to return the local link number |
Definition at line 605 of file ComtInfo.cpp.
bool forest::ComtInfo::readRateSpec | ( | istream & | in, |
RateSpec & | rs | ||
) |
Read a rate specification.
in | is an open input stream |
rs | is a reference to a RateSpec in which result is returned |
Definition at line 521 of file ComtInfo.cpp.
void forest::ComtInfo::releaseComtree | ( | int | ctx) |
Release a previously locked comtree.
Waiting threads are signalled to let them proceed.
ctx | is the index of a locked comtree. |
Definition at line 79 of file ComtInfo.cpp.
bool forest::ComtInfo::removeComtree | ( | int | ctx) |
Remove a comtree.
Assumes that all bandwidth resources in underlying network have already been released and that the calling thread already holds a lock on the comtree.
ctx | is the comtree index for a valid comtree to be removed |
Definition at line 168 of file ComtInfo.cpp.
|
inline |
Remove a core node from a comtree.
Really just removes it from mapping.
ctx | is the comtree index |
rtrAdr | is the forest address of the core node |
Definition at line 533 of file ComtInfo.h.
bool forest::ComtInfo::removeNode | ( | int | ctx, |
fAdr_t | fa | ||
) |
Remove a node from a comtree.
This method will fail if the node is a router with links to children Updates link counts at parent router.
ctx | is the comtree index |
fa | is the forest address of a comtree node |
Definition at line 223 of file ComtInfo.cpp.
void forest::ComtInfo::removePath | ( | int | ctx, |
list< LinkMod > & | path | ||
) |
Remove a path from a router in a comtree.
Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index for the comtree of interest |
path | is a list of LinkMod objects defining the path in bottom-up order; the path is assumed to have no "branching links" incident to the path |
Definition at line 1226 of file ComtInfo.cpp.
bool forest::ComtInfo::setAllComtRates | ( | ) |
Set rates for links in all comtrees.
This involves computing the required rate for each comtree link and allocating the required network capacity.
Definition at line 877 of file ComtInfo.cpp.
void forest::ComtInfo::setAutoConfigRates | ( | int | ctx) |
Set the backbone link capacities for an auto-configured comtree.
Assumes that current thread holds a lock on comtree, if one is needed.
ctx | is a valid comtree index |
u | is a node in the comtree (used in recursive calls) |
Definition at line 910 of file ComtInfo.cpp.
bool forest::ComtInfo::setComtRates | ( | int | ctx) |
Compute rates for all links in a comtree and allocate capacity of network links.
This is for use when configuring an entire comtree, not when processing joins/leaves. Assumes that the current thread is the only one with access to object right now.
ctx | is a valid comtree index |
Definition at line 892 of file ComtInfo.cpp.
|
inline |
Set the backbone configuration mode of a comtree.
ctx | is the index of the comtree |
auto | is the new configuration mode |
Definition at line 495 of file ComtInfo.h.
|
inline |
Set the owner of a comtree.
ctx | is the index of the comtree |
owner | is the forest address of the comtree owner |
Definition at line 465 of file ComtInfo.h.
Set the parent of a leaf in the comtree.
ctx | is a valid comtree index |
leaf | is the forest address for a leaf in the comtree |
parent | is the forest address of the parent node in the comtree |
llnk | is the local link number that the parent uses to reach leaf |
Definition at line 577 of file ComtInfo.h.
|
inline |
Set the parent link of a router in the comtree.
Update link counts at router and its parent in the process.
ctx | is a valid comtree index |
rtr | is the forest address for a router in the comtree |
plnk | is the link number of a link in the comtree |
Definition at line 545 of file ComtInfo.h.
|
inline |
Set the root node of a comtree.
ctx | is the index of the comtree |
r | is the forest address of the router the new comtree root |
Definition at line 476 of file ComtInfo.h.
|
inline |
Thaw (unfreeze) the rate of a comtree link.
ctx | is a valid comtree index |
rtr | is a forest address for a router in the comtree; this method unfreezes the rate of the parent link at rtr |
Definition at line 606 of file ComtInfo.h.
string & forest::ComtInfo::toString | ( | string & | s) |
Create a string representation of the ComtInfo object.
Does not do any locking, so may produce inconsistent results in multi-threaded environment.
s | is a reference to a string in which the result is returned |
Definition at line 1368 of file ComtInfo.cpp.
void forest::ComtInfo::unprovision | ( | int | ctx) |
Unprovision all links in a comtree,increasing available link capacity.
Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is a valid comtree index |
Definition at line 1008 of file ComtInfo.cpp.
void forest::ComtInfo::unprovision | ( | int | ctx, |
list< LinkMod > & | modList | ||
) |
Reduce the capacity of a list of comtree links and release required link capacity in the network.
Assumes that current thread holds a lock on comtree and NetInfo object.
ctx | is the index of a comptree |
modList | is a list of nodes, each representing a link in the comtree and a RateSpec difference to be removed from that link. |
Definition at line 1347 of file ComtInfo.cpp.
|
inline |
Check to see if a given comtree index is valid.
ComtInfo uses integer indices in a restricted range to access comtree information efficiently. Users get the comtree index for a given comtree number using the lookupComtree() method.
ctx | is an integer comtree index |
Definition at line 200 of file ComtInfo.h.
|
inline |
Check to see if a given comtree number is valid.
comt | is an integer comtree number |
Definition at line 188 of file ComtInfo.h.