bamboo.dht
Class PutGetTest

java.lang.Object
  extended by bamboo.util.StandardStage
      extended by bamboo.dht.PutGetTest
All Implemented Interfaces:
EventHandlerIF, SingleThreadedEventHandlerIF

public class PutGetTest
extends StandardStage

A put and get test for PlanetLab. Also, we've completely abandoned the SandStorm model here except for startup (in the init function); everything is functions and callbacks.

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

Nested Class Summary
static class PutGetTest.GetInfo
           
static class PutGetTest.PutInfo
           
 
Field Summary
protected  GatewayClient client
           
 boolean die_on_failure
           
protected  MessageDigest digest
           
 Curry.Thunk1<PutGetTest.GetInfo> get_again_cb
           
 Curry.Thunk2<PutGetTest.GetInfo,bamboo_get_res> get_done_cb
           
 Curry.Thunk1<Long> get_timeout_cb
           
 long GET_TIMEOUT_MS
           
 PrintWriter log
           
 long MAX_GET_TIME_MS
           
protected  double mean_get_period_ms
           
protected  double mean_put_period_ms
           
 Runnable next_get_op_cb
           
 Runnable next_put_op_cb
           
protected  long next_seq
           
protected  HashMap<Long,PutGetTest.GetInfo> pending_gets
           
protected  HashMap<Long,bamboo_put_args> pending_puts
           
 Curry.Thunk4<bamboo_put_args,Long,Long,Integer> put_done_cb
           
protected  int[] put_sizes
           
 Curry.Thunk1<Long> put_timeout_cb
           
 long PUT_TIMEOUT_MS
           
protected  HashSet<PutGetTest.PutInfo> puts
           
protected  Random rand
           
protected  int storage_goal
           
protected  int total_storage
           
protected  int[] ttl_values
           
 
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
PutGetTest()
           
 
Method Summary
 void init(ConfigDataIF config)
           
protected  void log_put(PutGetTest.PutInfo pi, PrintWriter out)
           
protected  void next_get_op()
           
protected  void next_put_op()
           
static double random_exponential(double mean, Random rand)
           
protected  void recover(String put_log_path)
           
 
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

GET_TIMEOUT_MS

public long GET_TIMEOUT_MS

PUT_TIMEOUT_MS

public long PUT_TIMEOUT_MS

MAX_GET_TIME_MS

public long MAX_GET_TIME_MS

die_on_failure

public boolean die_on_failure

log

public PrintWriter log

rand

protected Random rand

puts

protected HashSet<PutGetTest.PutInfo> puts

digest

protected MessageDigest digest

client

protected GatewayClient client

mean_get_period_ms

protected double mean_get_period_ms

mean_put_period_ms

protected double mean_put_period_ms

storage_goal

protected int storage_goal

total_storage

protected int total_storage

ttl_values

protected int[] ttl_values

put_sizes

protected int[] put_sizes

next_seq

protected long next_seq

pending_puts

protected HashMap<Long,bamboo_put_args> pending_puts

pending_gets

protected HashMap<Long,PutGetTest.GetInfo> pending_gets

next_put_op_cb

public Runnable next_put_op_cb

put_timeout_cb

public Curry.Thunk1<Long> put_timeout_cb

next_get_op_cb

public Runnable next_get_op_cb

get_timeout_cb

public Curry.Thunk1<Long> get_timeout_cb

put_done_cb

public Curry.Thunk4<bamboo_put_args,Long,Long,Integer> put_done_cb

get_done_cb

public Curry.Thunk2<PutGetTest.GetInfo,bamboo_get_res> get_done_cb

get_again_cb

public Curry.Thunk1<PutGetTest.GetInfo> get_again_cb
Constructor Detail

PutGetTest

public PutGetTest()
Method Detail

random_exponential

public static double random_exponential(double mean,
                                        Random rand)

next_get_op

protected void next_get_op()

next_put_op

protected void next_put_op()

log_put

protected void log_put(PutGetTest.PutInfo pi,
                       PrintWriter out)

recover

protected void recover(String put_log_path)

init

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