net.sf.sparql.benchmarking.parallel
Class AbstractParallelClientManager<T extends Options>

java.lang.Object
  extended by net.sf.sparql.benchmarking.parallel.AbstractParallelClientManager<T>
Type Parameters:
T - Options type
All Implemented Interfaces:
Callable<Object>, ParallelClientManager<T>
Direct Known Subclasses:
BenchmarkParallelClientManager, SoakTestParallelClientManager

public abstract class AbstractParallelClientManager<T extends Options>
extends Object
implements ParallelClientManager<T>

Abstract implementation of a parallel client manager

Author:
rvesse

Constructor Summary
AbstractParallelClientManager(Runner<T> runner, T options)
          Creates a new parallel client manager
 
Method Summary
 Object call()
          Runs the parallel clients
 ParallelClient<T> createClient(int id)
          Creates a new parallel client
 T getOptions()
          Gets the options
 Runner<T> 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 isReady()
          Gets whether the manager is ready for clients to begin executing
protected  void setReady()
          Sets that the client manager is ready
protected  boolean shouldHalt()
          Gets whether the client should be halting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.sparql.benchmarking.parallel.ParallelClientManager
completeRun, hasFinished, shouldRun, startRun
 

Constructor Detail

AbstractParallelClientManager

public AbstractParallelClientManager(Runner<T> runner,
                                     T options)
Creates a new parallel client manager

Parameters:
runner - Runner
options - Options
Method Detail

getOptions

public final T getOptions()
Description copied from interface: ParallelClientManager
Gets the options

Specified by:
getOptions in interface ParallelClientManager<T extends Options>
Returns:
Options

getRunner

public final Runner<T> getRunner()
Description copied from interface: ParallelClientManager
Gets the runner

Specified by:
getRunner in interface ParallelClientManager<T extends Options>
Returns:
Runner

isReady

public final boolean isReady()
Description copied from interface: ParallelClientManager
Gets whether the manager is ready for clients to begin executing

Specified by:
isReady in interface ParallelClientManager<T extends Options>
Returns:
True if the manager is ready, false otherwise

setReady

protected final void setReady()
Sets that the client manager is ready


halt

public final void halt()
Description copied from interface: ParallelClientManager
Method called by parallel clients to tell the manager that they encountered a halting condition and thus all clients should halt

Specified by:
halt in interface ParallelClientManager<T extends Options>

shouldHalt

protected final boolean shouldHalt()
Gets whether the client should be halting

Returns:
True if should be halting, false otherwise

call

public Object call()
            throws Exception
Runs the parallel clients

Specified by:
call in interface Callable<Object>
Throws:
Exception

createClient

public ParallelClient<T> createClient(int id)
Description copied from interface: ParallelClientManager
Creates a new parallel client

Specified by:
createClient in interface ParallelClientManager<T extends Options>
Parameters:
id - Client ID
Returns:
Parallel client


Copyright © 2014. All Rights Reserved.