Rice Pastry API

org.mpisws.p2p.testing.transportlayer.replay
Class Recorder

java.lang.Object
  extended by org.mpisws.p2p.testing.transportlayer.replay.Recorder
All Implemented Interfaces:
MyEvents

public class Recorder
extends java.lang.Object
implements MyEvents

This tutorial shows how to use Scribe.

Author:
Jeff Hoye

Nested Class Summary
 class Recorder.AppInvokation
           
 class Recorder.PublishInvokation
           
 class Recorder.SubscribeInvokation
           
 
Field Summary
 
Fields inherited from interface org.mpisws.p2p.testing.transportlayer.replay.MyEvents
EVT_BOOT, EVT_PUBLISH, EVT_SUBSCRIBE
 
Constructor Summary
Recorder(int bindport, java.net.InetSocketAddress bootaddress, int numNodes, Environment env)
          Based on the rice.tutorial.lesson4.DistTutorial This constructor launches numNodes PastryNodes.
 
Method Summary
static NodeHandle getRoot(NodeHandle seed, java.util.Hashtable<NodeHandle,MyScribeClient> appTable)
          Recursively crawl up the tree to find the root.
static void main(java.lang.String[] args)
          Usage: java [-cp FreePastry- .jar] rice.tutorial.lesson6.ScribeTutorial localbindport bootIP bootPort numNodes example java rice.tutorial.DistTutorial 9001 pokey.cs.almamater.edu 9001
 void printLog(java.lang.String arg, Environment env)
           
static void printTree(java.util.ArrayList<MyScribeClient> apps)
          Note that this function only works because we have global knowledge.
static void recursivelyPrintChildren(NodeHandle curNode, int recursionDepth, java.util.Hashtable<NodeHandle,MyScribeClient> appTable)
          Print's self, then children.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Recorder

public Recorder(int bindport,
                java.net.InetSocketAddress bootaddress,
                int numNodes,
                Environment env)
         throws java.lang.Exception
Based on the rice.tutorial.lesson4.DistTutorial This constructor launches numNodes PastryNodes. They will bootstrap to an existing ring if one exists at the specified location, otherwise it will start a new ring.

Parameters:
bindport - the local port to bind to
bootaddress - the IP:port of the node to boot from
numNodes - the number of nodes to create in this JVM
env - the Environment
Throws:
java.lang.Exception
Method Detail

printLog

public void printLog(java.lang.String arg,
                     Environment env)
              throws java.io.IOException
Throws:
java.io.IOException

printTree

public static void printTree(java.util.ArrayList<MyScribeClient> apps)
Note that this function only works because we have global knowledge. Doing this in an actual distributed environment will take some more work.

Parameters:
apps - Vector of the applicatoins.

getRoot

public static NodeHandle getRoot(NodeHandle seed,
                                 java.util.Hashtable<NodeHandle,MyScribeClient> appTable)
Recursively crawl up the tree to find the root.


recursivelyPrintChildren

public static void recursivelyPrintChildren(NodeHandle curNode,
                                            int recursionDepth,
                                            java.util.Hashtable<NodeHandle,MyScribeClient> appTable)
Print's self, then children.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Usage: java [-cp FreePastry- .jar] rice.tutorial.lesson6.ScribeTutorial localbindport bootIP bootPort numNodes example java rice.tutorial.DistTutorial 9001 pokey.cs.almamater.edu 9001

Throws:
java.lang.Exception

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection