bamboo.openhash.fileshare
Class FileShare

java.lang.Object
  extended by bamboo.util.StandardStage
      extended by bamboo.openhash.fileshare.FileShare
All Implemented Interfaces:
EventHandlerIF, SingleThreadedEventHandlerIF

public class FileShare
extends StandardStage

A CFS-like file sharing program.

Version:
$Id: FileShare.java,v 1.5 2005/03/02 02:25:13 srhea Exp $
Author:
Sean C. Rhea

Field Summary
protected static String APPLICATION
           
protected static int BRANCHING
           
protected  GatewayClient client
           
 Curry.Thunk3<bamboo_get_args,Long,bamboo_get_res> get_done_cb
           
protected  FileInputStream is
           
protected  byte[] key
           
protected static int MAX_BUFFER
           
protected static int MAX_PARALLEL
           
protected  MessageDigest md
           
protected  FileOutputStream os
           
protected  int outstanding
           
 Curry.Thunk2<bamboo_put_args,Integer> put_done_cb
           
protected  Vector<PriorityQueue> rblocks
           
protected  LinkedList<Pair<byte[],ByteBuffer>> ready
           
protected  Vector<Long> rnext
           
protected  byte[] secret
           
protected  int ttl
           
protected  Vector<LinkedList<ByteBuffer>> wblocks
           
 
Fields inherited from class bamboo.util.StandardStage
acore, classifier, DEBUG, event_types, inb_msg_types, logger, my_node_id, my_sink, outb_msg_types, sim_running
 
Constructor Summary
FileShare()
           
 
Method Summary
 void init(ConfigDataIF config)
           
static void main(String[] args)
           
 void make_parents(boolean done)
          Transfer wblocks from the wblocks array to the ready queue.
 void read()
           
 void write()
           
 
Methods inherited from class bamboo.util.StandardStage
BUG, BUG, BUG, config_get_boolean, config_get_double, config_get_int, config_get_string, configGetInt, destroy, dispatch, enqueue, handleEvent, handleEvents, lookup_stage, now_ms, timer_ms
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BRANCHING

protected static final int BRANCHING
See Also:
Constant Field Values

MAX_BUFFER

protected static final int MAX_BUFFER
See Also:
Constant Field Values

MAX_PARALLEL

protected static final int MAX_PARALLEL
See Also:
Constant Field Values

APPLICATION

protected static final String APPLICATION
See Also:
Constant Field Values

ttl

protected int ttl

md

protected MessageDigest md

client

protected GatewayClient client

is

protected FileInputStream is

os

protected FileOutputStream os

secret

protected byte[] secret

ready

protected LinkedList<Pair<byte[],ByteBuffer>> ready

wblocks

protected Vector<LinkedList<ByteBuffer>> wblocks

rblocks

protected Vector<PriorityQueue> rblocks

rnext

protected Vector<Long> rnext

outstanding

protected int outstanding

key

protected byte[] key

put_done_cb

public Curry.Thunk2<bamboo_put_args,Integer> put_done_cb

get_done_cb

public Curry.Thunk3<bamboo_get_args,Long,bamboo_get_res> get_done_cb
Constructor Detail

FileShare

public FileShare()
          throws Exception
Throws:
Exception
Method Detail

init

public void init(ConfigDataIF config)
          throws Exception
Specified by:
init in interface EventHandlerIF
Overrides:
init in class StandardStage
Throws:
Exception

make_parents

public void make_parents(boolean done)
Transfer wblocks from the wblocks array to the ready queue.


write

public void write()

read

public void read()

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception