planet.test.dht2
Class DHTTest

java.lang.Object
  extended byplanet.generic.commonapi.GenericApp
      extended byplanet.test.dht2.DHTTest

public class DHTTest
extends GenericApp

Main application that tests to inserts a wide number of key/value pairs at the ring and lookups a concrete existing key.

Version:
1.0
Author:
Carles Pairot , Jordi Pujol , Marc Sanchez

Constructor Summary
DHTTest()
          Constructor that initialize a network with MAX_NODES, and register over each node an instance of SymphonyDHTApplication.
 
Method Summary
 void insertAll(java.lang.String insertSet, DHTApplication app, Network network)
          This methods insert all keys from a file called insertSet to DHT.
 void lookupAll(java.lang.String lookupSet, int UpperBound, DHTApplication app, Network network)
          This method launches several lookup operation into Symphony Ring.
static void main(java.lang.String[] args)
          Initialize a network with the number of nodes specified by command line argument, and inserts all keys/values existing at file claves.txt.
 
Methods inherited from class planet.generic.commonapi.GenericApp
printNetwork, restart, start, timeElapsedInSeconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DHTTest

public DHTTest()
        throws InitializationException
Constructor that initialize a network with MAX_NODES, and register over each node an instance of SymphonyDHTApplication.

Method Detail

insertAll

public void insertAll(java.lang.String insertSet,
                      DHTApplication app,
                      Network network)
               throws java.io.FileNotFoundException
This methods insert all keys from a file called insertSet to DHT.

Parameters:
insertSet - The filename with all data to insert.
app - The instance class object of the DHT application.
network - The handler from the overlay network.
Throws:
java.io.FileNotFoundException - If file called insertSet is unavailable.

lookupAll

public void lookupAll(java.lang.String lookupSet,
                      int UpperBound,
                      DHTApplication app,
                      Network network)
               throws java.io.FileNotFoundException
This method launches several lookup operation into Symphony Ring.

Parameters:
lookupSet - The lookup set with all keys to retrieve.
UpperBound - The maximum number of lookups launched by this method.
app - The instance class object of the DHT application.
network - The handler from the overlay network.
Throws:
java.io.FileNotFoundException - If file called lookupSet is unavailable.

main

public static void main(java.lang.String[] args)
Initialize a network with the number of nodes specified by command line argument, and inserts all keys/values existing at file claves.txt.

Parameters:
args -