edu.usc.bg.base
Class ClientThread

java.lang.Object
  extended by java.lang.Thread
      extended by edu.usc.bg.base.ClientThread
All Implemented Interfaces:
java.lang.Runnable

public class ClientThread
extends java.lang.Thread

A thread for executing transactions or data inserts to the database.

Author:
cooperb

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ClientThread(DB db, boolean dotransactions, Workload workload, int threadid, int threadcount, java.util.Properties props, int opcount, double targetperthreadperms, boolean warmup)
          Constructor.
 
Method Summary
 void cleanup()
           
 int getActsDone()
           
 int getOpsDone()
           
 boolean initThread()
           
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientThread

public ClientThread(DB db,
                    boolean dotransactions,
                    Workload workload,
                    int threadid,
                    int threadcount,
                    java.util.Properties props,
                    int opcount,
                    double targetperthreadperms,
                    boolean warmup)
Constructor.

Parameters:
db - The DB implementation to use.
dotransactions - True to do transactions, false to insert data or create schema.
workload - The workload to use.
threadid - The id of this thread.
threadcount - The total number of threads.
props - The properties defining the experiment.
opcount - The number of operations (transactions or inserts) to do.
targetperthreadperms - Target number of operations per thread per ms.
warmup - Identifies if its the warmup phase so update requests would not be issued.
Method Detail

getOpsDone

public int getOpsDone()

getActsDone

public int getActsDone()

initThread

public boolean initThread()

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

cleanup

public void cleanup()