Rice Pastry API

rice.scribe.testing
Class DirectScribeMaintenanceTest

java.lang.Object
  |
  +--rice.scribe.testing.DirectScribeMaintenanceTest

public class DirectScribeMaintenanceTest
extends java.lang.Object

Version:
$Id: DirectScribeMaintenanceTest.java,v 1.16 2003/01/26 20:57:19 atuls Exp $
Author:
Atul Singh, Animesh Nandi

Nested Class Summary
 class DirectScribeMaintenanceTest.TestAnycastMessage
          A dummy test message used for checking if anycast is doing DFS correctly.
 
Field Summary
 java.util.Hashtable nodeIdToApp
           
 java.util.Vector scribeClients
           
 
Constructor Summary
DirectScribeMaintenanceTest()
           
 
Method Summary
 int BFS(rice.pastry.NodeId topicId)
          This does the Breadth First Traversal of the multicast tree for a topic.
 boolean checkAnycastDFS(rice.pastry.NodeId topicId)
          Checks the DFS implemented by MessageAnycast class.
 boolean checkNewJoin(rice.pastry.NodeId topicId)
          A test for checking if data was correctly propogated along subscribe messages if new join method was used, which takes data as a parameter.
 boolean checkParentPointerForAllTopics(int nodeIndex)
          Check if parent pointer is set for all topics on the specified node.
 boolean checkRemoveChild(rice.pastry.NodeId topicId)
          Tests the removeChild interface method.
 boolean childParentViewConsistencyTest(int nodeIndex)
          Here we are trying to check that the parent-child relationship is consistent from the view of the CHILD as well as the PARENT, on given node.
 boolean distinctChildrenTableConsistencyTest(int nodeIndex)
          Check the consistency between distinctChildrenTable maintained by scribe on a node and the children maintained by each Topic on that node.
 boolean distinctParentTableConsistencyTest(int nodeIndex)
          Check the consistency between distinctParentTable maintained by scribe on a node and the parent maintained by each Topic on that node.
 boolean doTesting()
          The system of nodes is set up and the testing is performed while stepwise failing the desired number of nodes.
 rice.pastry.NodeId generateTopicId(java.lang.String topicName)
           
 void joinNodes(int num)
          Creates the specified number of new nodes and joins them to the existing Pastry network.
 void makeScribeNode()
           
 int rootApp(rice.pastry.NodeId topicId)
          This returns the index of the application that is currently the root for the topic's multicast tree.
 void scheduleHBOnAllNodes()
          Schedule a HeartBeat event on all nodes for all topics.
 void scheduleTROnAllNodes()
          Schedule a TreeRepair event on all nodes for all the topics.
 boolean setParentAndaddChildTest()
          Checks whether setParent and addChild works correctly.
 boolean simulate()
           
static boolean start()
          Main entry point for the test suite.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scribeClients

public java.util.Vector scribeClients

nodeIdToApp

public java.util.Hashtable nodeIdToApp
Constructor Detail

DirectScribeMaintenanceTest

public DirectScribeMaintenanceTest()
Method Detail

makeScribeNode

public void makeScribeNode()

joinNodes

public void joinNodes(int num)
Creates the specified number of new nodes and joins them to the existing Pastry network. We also make the nodes subscribe to all the topics. We also have to initiate leafset and routeset maintenance to make the presence of these newly created nodes be reflected in the leafsets and routesets of other nodes as required.


simulate

public boolean simulate()

start

public static boolean start()
Main entry point for the test suite.

Returns:
true if all the tests PASSED

doTesting

public boolean doTesting()
The system of nodes is set up and the testing is performed while stepwise failing the desired number of nodes.

Returns:
true if all the tests PASSED

generateTopicId

public rice.pastry.NodeId generateTopicId(java.lang.String topicName)

rootApp

public int rootApp(rice.pastry.NodeId topicId)
This returns the index of the application that is currently the root for the topic's multicast tree.

Parameters:
topicId - the topic id of the multicast tree.
Returns:
index of application that is the root of topic's multicast tree.

BFS

public int BFS(rice.pastry.NodeId topicId)
This does the Breadth First Traversal of the multicast tree for a topic.

Parameters:
topicId - the topic id of the multicast tree to be traversed
Returns:
the total number of nodes in the tree OR returns -1 if the graph is not a TREE (it could be a DAG or maybe a cycle was detected.

distinctChildrenTableConsistencyTest

public boolean distinctChildrenTableConsistencyTest(int nodeIndex)
Check the consistency between distinctChildrenTable maintained by scribe on a node and the children maintained by each Topic on that node.

Parameters:
nodeIndex - index of specfied node.
Returns:
true if the test passes, else false

distinctParentTableConsistencyTest

public boolean distinctParentTableConsistencyTest(int nodeIndex)
Check the consistency between distinctParentTable maintained by scribe on a node and the parent maintained by each Topic on that node.

Parameters:
nodeIndex - index of specfied node.
Returns:
true if test passes, else false

checkParentPointerForAllTopics

public boolean checkParentPointerForAllTopics(int nodeIndex)
Check if parent pointer is set for all topics on the specified node.

Parameters:
nodeIndex - index of specfied node.
Returns:
true if test passes, else false

scheduleTROnAllNodes

public void scheduleTROnAllNodes()
Schedule a TreeRepair event on all nodes for all the topics.


scheduleHBOnAllNodes

public void scheduleHBOnAllNodes()
Schedule a HeartBeat event on all nodes for all topics.


childParentViewConsistencyTest

public boolean childParentViewConsistencyTest(int nodeIndex)
Here we are trying to check that the parent-child relationship is consistent from the view of the CHILD as well as the PARENT, on given node.

Parameters:
nodeIndex - index of specfied node.
Returns:
true if the test passes, else false.

setParentAndaddChildTest

public boolean setParentAndaddChildTest()
Checks whether setParent and addChild works correctly. A node(X) is picked and its parent is set to another random node(Y), and then X is added as a child in Y's children table. Then, different trees are analysed to see if everything is correct. This procedure is followed for all nodes in system.


checkAnycastDFS

public boolean checkAnycastDFS(rice.pastry.NodeId topicId)
Checks the DFS implemented by MessageAnycast class. Every node sends a dummy anycast message to a topic (and we make sure that no one responds to it, i.e. no node is able to satisfy the request). Now, after it fails, we print how many nodes did it travelled, which should be equal to number of nodes alive in system, since every node subscribes to all topics.


checkNewJoin

public boolean checkNewJoin(rice.pastry.NodeId topicId)
A test for checking if data was correctly propogated along subscribe messages if new join method was used, which takes data as a parameter.


checkRemoveChild

public boolean checkRemoveChild(rice.pastry.NodeId topicId)
Tests the removeChild interface method. A random node picks one of its children for given topic, and removes it. Now, after this its list of children for this topic are checked and this child should not be there.


Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection