Fairness.Trees
Class RandomTreeManager

java.lang.Object
  extended by Fairness.Trees.TreeManager
      extended by Fairness.Trees.RandomTreeManager

public class RandomTreeManager
extends TreeManager

RandomTreeManager constructs a tree randomly by giving each node a single turn to join a tree. The manager searches the nodes in the desired stripe tree randomly by visiting nodes in that stripe tree until it finds an appropriate parent for the joining node.


Field Summary
 
Fields inherited from class Fairness.Trees.TreeManager
sim
 
Constructor Summary
RandomTreeManager()
           
 
Method Summary
 int getNextNodeId()
          Returns the next node ID using the node ID allocation algorithm from this TreeManager.
 java.util.Collection<Node> getRootNodes()
          After a tree reconstruction, returns the nodes that are the roots of their stripe trees.
 void rebuildTree()
          A method to completely rebuild the Node tree given all nodes in the system.
 
Methods inherited from class Fairness.Trees.TreeManager
addNode, forestToString, getAllNodes, setUp, setUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomTreeManager

public RandomTreeManager()
Method Detail

getRootNodes

public java.util.Collection<Node> getRootNodes()
After a tree reconstruction, returns the nodes that are the roots of their stripe trees. It is assumed that the Node is the root of its primary stripe and of no other. That is, Node getParent( getStripeId() ) should return null.

Specified by:
getRootNodes in class TreeManager
Returns:
non-null Collection of 0 or more Node.

rebuildTree

public void rebuildTree()
A method to completely rebuild the Node tree given all nodes in the system.

Specified by:
rebuildTree in class TreeManager

getNextNodeId

public int getNextNodeId()
Returns the next node ID using the node ID allocation algorithm from this TreeManager.

Specified by:
getNextNodeId in class TreeManager