|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.sun.slamd.job.JobClass
com.sun.slamd.loadvariance.LoadVarianceJobClass
This class defines a SLAMD job that varies the load that it generates over time based on input read from a file that controls the number of threads that should be active at any given time. It works by creating and starting all threads at the beginning of the job but making them remain inactive until they are needed.
| Field Summary | |
static int |
DEFAULT_IDLE_SLEEP_DURATION
The default length of time in milliseconds that an idle thread should sleep between checks to determine whether it is time to start running. |
static java.lang.String |
PARAM_LOAD_DEFINITION
The name of the parameter that will be used to specify the URL to the file containing the load definition. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
LoadVarianceJobClass()
The default constructor used to create a new instance of the search thread. |
|
| Method Summary | |
abstract void |
doProcessing()
Performs the actual processing for this job. |
abstract void |
doShutdown()
Performs any processing that should be done at the very end of execution after all actual processing has completed. |
abstract void |
doStartup()
Performs any processing that should be done at the very beginning of execution before any actual processing is performed. |
int |
getIdleSleepDuration()
Retrieves the length of time in milliseconds that each thread will sleep while it is idle before checking to determine whether it is time to start running. |
Parameter |
getVariableLoadParameterStub()
Retrieves the parameter that is used to specify the URL to the data file containing the variable load definition. |
void |
initializeVariableLoad(ParameterList parameters)
Initializes the logic that will be used to generate load for this thread. |
boolean |
loopVarianceDefinition()
Indicates whether the job should loop back through the load variance definition when the end is reached. |
void |
runJob()
Performs the processing associated with this job. |
void |
setIdleSleepDuration(int idleSleepDuration)
Specifies the length of time in milliseconds that each thread should sleep while it is idle before checking to determine whether it is time to start running. |
void |
setLoopVarianceDefinition(boolean loopVarianceDefinition)
Specifies whether the job should loop back through the load variance definition when the end is reached. |
boolean |
shouldPauseOrStop()
Indicates whether this thread should temporarily pause its execution or stop altogether. |
void |
validateLoadDefinition(int threadsPerClient,
java.util.Date startTime,
java.util.Date stopTime,
int duration,
ParameterList parameters)
Validates the information in the load definition file both for its syntax and for plausibility when used with the other provided information. |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_IDLE_SLEEP_DURATION
public static final java.lang.String PARAM_LOAD_DEFINITION
| Constructor Detail |
public LoadVarianceJobClass()
initialize
method.
| Method Detail |
public final Parameter getVariableLoadParameterStub()
public final void validateLoadDefinition(int threadsPerClient,
java.util.Date startTime,
java.util.Date stopTime,
int duration,
ParameterList parameters)
throws InvalidValueException
threadsPerClient - The number of threads per client that have been
scheduled for this job.startTime - The time that this job should start running.stopTime - The time that this job should stop running.duration - The maximum length of time in seconds that the
job should be allowed to run.parameters - The set of parameters associated with this job,
including the load definition URL parameter.
InvalidValueException
public final void initializeVariableLoad(ParameterList parameters)
throws UnableToRunException
initializeClient method, as it
uses static variables to determine the logic to use for all threads. The
runJob method will be used to apply this definition on a
per-thread basis.
parameters - The parameter list containing the parameters for this
job, including the load definition URL parameter.
UnableToRunException - If a problem occurs while parsing the load
definition file that would keep this job
from running properly.public int getIdleSleepDuration()
public void setIdleSleepDuration(int idleSleepDuration)
initializeVariableLoad or it will be overridden.
idleSleepDuration - The length of time in milliseconds that each
thread should sleep while it is idle before
checking to determine whether it is time to
start running.public boolean loopVarianceDefinition()
true if the job should loop back through the load
variance definition when the end is reached, or false
if not.public void setLoopVarianceDefinition(boolean loopVarianceDefinition)
loopVarianceDefinition - Indicates whether the job should loop back
through the load variance definition when
the end is reached.public final void runJob()
runJob in class JobClasspublic final boolean shouldPauseOrStop()
doProcessing method, and if it returns true then
doProcessing should exit.
public abstract void doStartup()
public abstract void doShutdown()
public abstract void doProcessing()
shouldPauseOrStop method and if it returns
true then this method should exit.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||