|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.sparql.benchmarking.parallel.impl.StressTestParallelClientManager
public class StressTestParallelClientManager
A Callable uses to manage the running of parallel clients for stress testing
Constructor Summary | |
---|---|
StressTestParallelClientManager(Runner<StressOptions> runner,
StressOptions options)
Creates a new Parallel Client Manager |
Method Summary | |
---|---|
Object |
call()
|
int |
completeRun()
Method that will be called by parallel clients to indicate they have completed a run and to obtain what run completion number it is |
ParallelClient<StressOptions> |
createClient(int id)
Creates a new parallel client |
protected boolean |
exceededMaxRuntime()
Gets whether the maximum run time has been exceeded |
long |
getCurrentClientCount()
Gets the current number of parallel clients in-use |
StressOptions |
getOptions()
Gets the options |
Runner<StressOptions> |
getRunner()
Gets the runner |
void |
halt()
Method called by parallel clients to tell the manager that they encountered a halting condition and thus all clients should halt |
boolean |
hasFinished()
Returns whether the parallel clients have finished all necessary runs |
boolean |
isReady()
Gets whether the manager is ready for clients to begin executing |
boolean |
shouldRun()
Method that will be called by parallel clients to determine if they should continue to run, calls to this are thread safe |
boolean |
startRun()
Method that will be called by parallel clients to indicate they have started a new run |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StressTestParallelClientManager(Runner<StressOptions> runner, StressOptions options)
runner
- Benchmark runneroptions
- OptionsMethod Detail |
---|
public long getCurrentClientCount()
public Object call() throws Exception
call
in interface Callable<Object>
Exception
protected boolean exceededMaxRuntime()
public boolean shouldRun()
ParallelClientManager
shouldRun
in interface ParallelClientManager<StressOptions>
public boolean startRun()
ParallelClientManager
A boolean is returned indicating whether the client should actually go
ahead with the run, this is to help avoid race conditions where multiple
threads check ParallelClientManager.shouldRun()
to see if they should proceed and then
attempt to start more runs than actually necessary.
startRun
in interface ParallelClientManager<StressOptions>
public int completeRun()
ParallelClientManager
completeRun
in interface ParallelClientManager<StressOptions>
public boolean hasFinished()
ParallelClientManager
hasFinished
in interface ParallelClientManager<StressOptions>
public void halt()
ParallelClientManager
halt
in interface ParallelClientManager<StressOptions>
public boolean isReady()
ParallelClientManager
isReady
in interface ParallelClientManager<StressOptions>
public Runner<StressOptions> getRunner()
ParallelClientManager
getRunner
in interface ParallelClientManager<StressOptions>
public StressOptions getOptions()
ParallelClientManager
getOptions
in interface ParallelClientManager<StressOptions>
public ParallelClient<StressOptions> createClient(int id)
ParallelClientManager
createClient
in interface ParallelClientManager<StressOptions>
id
- Client ID
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |