seda.sandStorm.test.bench.simple_sa
Class ClientStage

java.lang.Object
  extended by seda.sandStorm.test.bench.simple_sa.ClientStage
All Implemented Interfaces:
EventHandlerIF, SimpleP2PConst
Direct Known Subclasses:
ClientStageMulticlass

public class ClientStage
extends java.lang.Object
implements EventHandlerIF, SimpleP2PConst


Nested Class Summary
(package private)  class ClientStage.MessageSendEvent
           
(package private)  class ClientStage.MessageTimer
           
(package private)  class ClientStage.sendThread
           
 
Field Summary
protected  java.util.Vector arrivals
           
protected static int BUCKETSIZE
           
protected  SinkIF compQ
           
protected static boolean CONSTANT_RATE
           
protected static seda.util.StatsGatherer continuousRespStats
           
protected  int cur_seqNum
           
private static boolean DEBUG
           
(package private) static boolean first_mt
           
protected static seda.util.StatsGatherer injectTimeStats
           
protected static seda.util.StatsGatherer interArrivalTimeStats
           
(package private) static long last_inject_time
           
protected static int MIN_DELAY
           
protected  long MS_WAIT
           
protected  int MSGS_PER_SEND
           
protected  java.util.Hashtable msgTbl
           
protected static int NUM_MSGS
           
protected static java.util.Random rand
           
protected static double RATE
           
protected  SinkIF recvSink
           
protected static seda.util.StatsGatherer rejectedRespStats
           
protected static int REPORT_SAMPLES
           
protected static seda.util.StatsGatherer respStats
           
protected  java.util.Vector sendEvents
           
protected static int SKIP_SAMPLES
           
protected static boolean SPIN_SEND_THREAD
           
protected  long t_end
           
protected  long t_last
           
protected  long t_start
           
protected  ssTimer timer
           
protected  int total_completed
           
protected  int total_rcv
           
protected  int total_rejected
           
private static boolean VERBOSE
           
protected static double WARMUP_FRAC
           
protected static int WARMUP_MSGS
           
 
Fields inherited from interface seda.sandStorm.test.bench.simple_sa.SimpleP2PConst
MSG_SIZE, PORT
 
Constructor Summary
ClientStage()
           
 
Method Summary
protected  ClientStage.MessageSendEvent createMSE(int num_msgs)
           
 void destroy()
          Called when an event handler is destroyed.
protected  void doneWithMsg(Message msg, ClientStage.MessageTimer mt, long cur_time)
           
protected  void doReport(long t1, long t2)
           
protected  void doSender()
           
 void handleEvent(QueueElementIF item)
          Handle the event corresponding to the given QueueElementIF.
 void handleEvents(QueueElementIF[] items)
          Handle the events corresponding to the given QueueElementIF array.
 void init(ConfigDataIF config)
          Called when an event handler is initialized.
protected  void resetStats()
           
protected  void startSender()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
See Also:
Constant Field Values

WARMUP_FRAC

protected static final double WARMUP_FRAC
See Also:
Constant Field Values

CONSTANT_RATE

protected static final boolean CONSTANT_RATE
See Also:
Constant Field Values

SPIN_SEND_THREAD

protected static final boolean SPIN_SEND_THREAD
See Also:
Constant Field Values

BUCKETSIZE

protected static final int BUCKETSIZE
See Also:
Constant Field Values

SKIP_SAMPLES

protected static final int SKIP_SAMPLES
See Also:
Constant Field Values

MIN_DELAY

protected static final int MIN_DELAY
See Also:
Constant Field Values

REPORT_SAMPLES

protected static final int REPORT_SAMPLES
See Also:
Constant Field Values

RATE

protected static double RATE

NUM_MSGS

protected static int NUM_MSGS

WARMUP_MSGS

protected static int WARMUP_MSGS

respStats

protected static seda.util.StatsGatherer respStats

rejectedRespStats

protected static seda.util.StatsGatherer rejectedRespStats

continuousRespStats

protected static seda.util.StatsGatherer continuousRespStats

injectTimeStats

protected static seda.util.StatsGatherer injectTimeStats

interArrivalTimeStats

protected static seda.util.StatsGatherer interArrivalTimeStats

rand

protected static java.util.Random rand

compQ

protected SinkIF compQ

recvSink

protected SinkIF recvSink

total_rcv

protected int total_rcv

total_completed

protected int total_completed

total_rejected

protected int total_rejected

msgTbl

protected java.util.Hashtable msgTbl

cur_seqNum

protected int cur_seqNum

timer

protected ssTimer timer

MS_WAIT

protected long MS_WAIT

MSGS_PER_SEND

protected int MSGS_PER_SEND

sendEvents

protected java.util.Vector sendEvents

arrivals

protected java.util.Vector arrivals

t_start

protected long t_start

t_last

protected long t_last

t_end

protected long t_end

last_inject_time

static long last_inject_time

first_mt

static boolean first_mt
Constructor Detail

ClientStage

public ClientStage()
Method Detail

init

public void init(ConfigDataIF config)
          throws java.lang.Exception
Description copied from interface: EventHandlerIF
Called when an event handler is initialized. This method should perform any initialization operations as required by the application.

Specified by:
init in interface EventHandlerIF
Parameters:
config - The set of configuration parameters for the stage.
Throws:
java.lang.Exception - The EventHandler can indicate an error to the runtime during initialization by throwing an Exception.

destroy

public void destroy()
Description copied from interface: EventHandlerIF
Called when an event handler is destroyed. This method should perform any cleanup or shutdown operations as required by the application before the event handler is removed from the system.

Specified by:
destroy in interface EventHandlerIF

startSender

protected void startSender()

doSender

protected void doSender()

doneWithMsg

protected void doneWithMsg(Message msg,
                           ClientStage.MessageTimer mt,
                           long cur_time)

createMSE

protected ClientStage.MessageSendEvent createMSE(int num_msgs)

resetStats

protected void resetStats()

handleEvents

public void handleEvents(QueueElementIF[] items)
Description copied from interface: EventHandlerIF
Handle the events corresponding to the given QueueElementIF array. This method is invoked when multiple events are pending for the event handler. The application may reorder, filter, or drop these events if it wishes to do so.

Specified by:
handleEvents in interface EventHandlerIF

handleEvent

public void handleEvent(QueueElementIF item)
Description copied from interface: EventHandlerIF
Handle the event corresponding to the given QueueElementIF. This method is invoked by the system when a single event is pending for the event handler.

Specified by:
handleEvent in interface EventHandlerIF

doReport

protected void doReport(long t1,
                        long t2)