Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rice.pastry.testing
Class DistHelloWorld

    java.lang.Object
      rice.pastry.testing.DistHelloWorld

public class DistHelloWorld
extends java.lang.Object

A hello world example for pastry. This is the distributed driver. For example, run with default arguments on two machines, both with args -bootstrap firstmachine. Read the messages and follow the protocols. Either separately or with the above, try -nodes 3 and -nodes 20. Try -msgs 100. Try the two machine configuration, kill it, restart, and watch it join as a different node. Do that a few times, watch LeafSet entries accumulate, then in 30 seconds, watch the maintenance take over.

Version:
  $Id: DistHelloWorld.java,v 1.12 2005/03/15 22:07:04 jeffh Exp $
Author:
  Sitaram Iyer, Peter Druschel

Field Summary
`static int` | `protocol` DESCRIBE THE FIELD

Constructor Summary
`DistHelloWorld()` Constructor

Method Summary
`protected NodeHandle` | `getBootstrap(boolean firstNode)` Gets a handle to a bootstrap node.
`static void` | `main(java.lang.String[] args)` Usage: DistHelloWorld [-msgs m] [-nodes n] [-port p] [-bootstrap bshost[:bsport]] [-verbose|-silent|-verbosity v] [-help].
`PastryNode` | `makePastryNode(boolean firstNode)` Create a Pastry node and add it to pastryNodes.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### protocol

    public static int protocol

  DESCRIBE THE FIELD

Constructor Detail

### DistHelloWorld

    public DistHelloWorld()

  Constructor

Method Detail

### getBootstrap

    protected NodeHandle getBootstrap(boolean firstNode)

  Gets a handle to a bootstrap node. First we try localhost, to see whether a previous virtual node has already bound itself there. Then we try nattempts times on bshost:bsport. Then we fail.

  Parameters:
    `firstNode` - true of the first virtual node is being bootstrapped on this host
  Returns:
    handle to bootstrap node, or null.

### makePastryNode

    public PastryNode makePastryNode(boolean firstNode)

  Create a Pastry node and add it to pastryNodes. Also create a client application for this node, so that when this node comes up ( when pn.isReady() is true) , this application's notifyReady() method is called, and it can do any interesting stuff it wants.

  Parameters:
    `firstNode` - DESCRIBE THE PARAMETER
  Returns:
    DESCRIBE THE RETURN VALUE

### main

    public static void main(java.lang.String[] args)

  Usage: DistHelloWorld [-msgs m] [-nodes n] [-port p] [-bootstrap bshost[:bsport]] [-verbose|-silent|-verbosity v] [-help]. Ports p and bsport refer to RMI registry/ Socket port numbers (default = 5009). Without -bootstrap bshost[:bsport], only localhost:p is used for bootstrap. Default verbosity is 5, -verbose is 10, and -silent is -1 (error msgs only).

  Parameters:
    `args` - DESCRIBE THE PARAMETER

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Rice Pastry API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2005 - Rice Pastry.