Rice Pastry API

rice.tutorial.lesson6
Class ScribeTutorial

java.lang.Object
  extended byrice.tutorial.lesson6.ScribeTutorial

public class ScribeTutorial
extends java.lang.Object

This tutorial shows how to setup a FreePastry node using the Socket Protocol.

Version:
$Id: pretty.settings,v 1.3 2005/03/11 20:22:33 jeffh Exp $
Author:
Jeff Hoye

Constructor Summary
ScribeTutorial(int bindport, java.net.InetSocketAddress bootaddress, int numNodes)
          This constructor sets up a PastryNode.
 
Method Summary
static NodeHandle getRoot(NodeHandle seed, java.util.Hashtable appTable)
          Recursively crawl up the tree to find the root.
static void main(java.lang.String[] args)
          Usage: java [-cp FreePastry-.jar] rice.tutorial.DistTutorial localbindport bootIP bootPort example java rice.tutorial.DistTutorial 9001 pokey.cs.almamater.edu 9001
static void printTree(java.util.Vector apps)
          Note that this function only works because we have global knowledge.
static void recursivelyPrintChildren(NodeHandle curNode, int recursionDepth, java.util.Hashtable 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

ScribeTutorial

public ScribeTutorial(int bindport,
                      java.net.InetSocketAddress bootaddress,
                      int numNodes)
               throws java.lang.Exception
This constructor sets up a PastryNode. It will bootstrap to an existing ring if it can find one 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 - DESCRIBE THE PARAMETER
Throws:
java.lang.Exception - DESCRIBE THE EXCEPTION
Method Detail

getRoot

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

Parameters:
seed - DESCRIBE THE PARAMETER
appTable - DESCRIBE THE PARAMETER
Returns:
The Root value

printTree

public static void printTree(java.util.Vector 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.

recursivelyPrintChildren

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

Parameters:
curNode - DESCRIBE THE PARAMETER
recursionDepth - DESCRIBE THE PARAMETER
appTable - DESCRIBE THE PARAMETER

main

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

Parameters:
args - The command line arguments
Throws:
java.lang.Exception - DESCRIBE THE EXCEPTION

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection