seda.sandStorm.internal
Class AggTPSThreadManager

java.lang.Object
  extended by seda.sandStorm.internal.AggTPSThreadManager
All Implemented Interfaces:
ThreadManagerIF, sandStormConst

 class AggTPSThreadManager
extends java.lang.Object
implements ThreadManagerIF, sandStormConst

AggTPSThreadManager is a refinement of the TPSTM; it attempts to schedule stages to improve aggregation. The basic algorithm is to maintain a tunable "aggregation target", the minimum queue size threshold which triggers the execution of a stage's handler. This aggregation target is increased when more than 1 stage can meet the target, and reduced when no stages can meet it. A target of 1 is equivalent to the TPSTM algorithm.


Nested Class Summary
(package private)  class AggTPSThreadManager.appThread
          Internal class representing a single AggTPSTM-managed thread.
(package private)  class AggTPSThreadManager.governorThread
          Internal class implementing a thread governor - analyses appThread queue lengths and adjusts thread pool sizes accordingly.
(package private)  class AggTPSThreadManager.stageInfo
          Internal class representing state for a given stage.
(package private)  class AggTPSThreadManager.threadPool
           
 
Field Summary
private  int aggregationTarget
           
private static boolean DEBUG
           
private static boolean DEBUG_VERBOSE
           
private  java.lang.Thread governor
           
private  int governorDelay
           
private  int governorMaxThreads
           
private  int governorThreshold
           
private static int INITIAL_THREADPOOL_SIZE
           
private  java.lang.Object lock
           
private  int maxAggregation
           
private  java.util.Vector stages
           
private  java.lang.ThreadGroup tg
           
private  java.util.Vector threadpools
           
private  boolean useGovernor
           
 
Fields inherited from interface seda.sandStorm.internal.sandStormConst
MAJOR_VERSION, MINOR_VERSION, VERSION_STRING, WELCOME_STRING
 
Constructor Summary
AggTPSThreadManager(SandstormConfig config)
           
 
Method Summary
 void deregister(StageWrapperIF stage)
          Deregister a stage with this thread manager.
 void deregisterAll()
          Stop the thread manager and all threads managed by it.
 void register(StageWrapperIF stage)
          Register a stage with this thread manager.
 void stop()
          Stop the thread manager and all threads managed by it.
 
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

DEBUG_VERBOSE

private static final boolean DEBUG_VERBOSE
See Also:
Constant Field Values

INITIAL_THREADPOOL_SIZE

private static final int INITIAL_THREADPOOL_SIZE
See Also:
Constant Field Values

maxAggregation

private int maxAggregation

stages

private java.util.Vector stages

threadpools

private java.util.Vector threadpools

tg

private java.lang.ThreadGroup tg

governor

private java.lang.Thread governor

useGovernor

private boolean useGovernor

governorDelay

private int governorDelay

governorMaxThreads

private int governorMaxThreads

governorThreshold

private int governorThreshold

aggregationTarget

private int aggregationTarget

lock

private java.lang.Object lock
Constructor Detail

AggTPSThreadManager

AggTPSThreadManager(SandstormConfig config)
Method Detail

register

public void register(StageWrapperIF stage)
Register a stage with this thread manager.

Specified by:
register in interface ThreadManagerIF

deregister

public void deregister(StageWrapperIF stage)
Deregister a stage with this thread manager.

Specified by:
deregister in interface ThreadManagerIF

deregisterAll

public void deregisterAll()
Stop the thread manager and all threads managed by it.

Specified by:
deregisterAll in interface ThreadManagerIF

stop

public void stop()
Stop the thread manager and all threads managed by it.