net.sf.sparql.benchmarking.parallel
Interface ParallelClientManager<T extends Options>

Type Parameters:
T - Options type
All Superinterfaces:
Callable<Object>
All Known Implementing Classes:
AbstractParallelClientManager, BenchmarkParallelClientManager, SoakTestParallelClientManager, StressTestParallelClientManager

public interface ParallelClientManager<T extends Options>
extends Callable<Object>

Interface for parallel client managers

Author:
rvesse

Method Summary
 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<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 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 interface java.util.concurrent.Callable
call
 

Method Detail

shouldRun

boolean shouldRun()
Method that will be called by parallel clients to determine if they should continue to run, calls to this are thread safe

Returns:
True if a client should continue to run, false if they should terminate

startRun

boolean startRun()
Method that will be called by parallel clients to indicate they have started a new run

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 shouldRun() to see if they should proceed and then attempt to start more runs than actually necessary.

Returns:
True if the run should actually run, false otherwise

completeRun

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

Returns:
Run completion number

hasFinished

boolean hasFinished()
Returns whether the parallel clients have finished all necessary runs

Returns:
True if all runs have finished, false otherwise

halt

void halt()
Method called by parallel clients to tell the manager that they encountered a halting condition and thus all clients should halt


isReady

boolean isReady()
Gets whether the manager is ready for clients to begin executing

Returns:
True if the manager is ready, false otherwise

getRunner

Runner<T> getRunner()
Gets the runner

Returns:
Runner

getOptions

T getOptions()
Gets the options

Returns:
Options

createClient

ParallelClient<T> createClient(int id)
Creates a new parallel client

Parameters:
id - Client ID
Returns:
Parallel client


Copyright © 2014. All Rights Reserved.