net.sf.sparql.benchmarking.runners
Class AbstractRunner<T extends Options>

java.lang.Object
  extended by net.sf.sparql.benchmarking.runners.AbstractRunner<T>
Type Parameters:
T -
All Implemented Interfaces:
Runner<T>
Direct Known Subclasses:
BenchmarkRunner, SmokeRunner, SoakRunner, StressRunner

public abstract class AbstractRunner<T extends Options>
extends Object
implements Runner<T>

Abstract implementation of a runner providing common halting and progress reporting functionality

Author:
rvesse

Constructor Summary
AbstractRunner()
           
 
Method Summary
protected  void checkOperations(T options)
           
protected  boolean checkSanity(T options)
          Checks that the query endpoint/in-memory dataset being used passes some basic queries to see if it is up and running
protected  void finished(T options)
          Informs all registered progress listeners that the run has finished
protected  String[] getSanityCheckQueries()
          Gets the queries used for sanity checking
 void halt(T options, Exception e)
          Requests that the run be halted, exact halting conditions and behaviour is specified by the given options
 void halt(T options, String message)
          Requests that the run be halted, exact halting conditions and behaviour is specified by the given options
 void reportAfterOperation(T options, Operation operation, OperationRun run)
          Reports progress after we have run an operation
 void reportAfterOperationMix(T options, OperationMix mix, OperationMixRun run)
          Reports progress after we complete a run of the operation mix
 void reportBeforeOperation(T options, Operation operation)
          Reports progress before we run an operation
 void reportBeforeOperationMix(T options, OperationMix mix)
          Reports progress before we run an operation mix
protected  void reportCategorizedErrors(T options, Map<Integer,List<OperationRun>> categorizedErrors)
          Reports categorized errors
protected  void reportGeneralOptions(T options)
          Reports information about the general options specified
protected  void reportOperationSummary(T options, Operation op)
          Reports a summary of the operation
 void reportPartialProgress(T options, String message)
          Reports progress with an informational message
 void reportProgress(T options)
          Reports a newline as a progress message
 void reportProgress(T options, String message)
          Reports progress with an informational message
protected  OperationMixRun runMix(T options)
          Runs the actual operation mix using the configured operation mix runner, if there is no configured runner then it uses the DefaultOperationMixRunner to run the mix
protected  OperationRun runOp(T options, Operation op)
          Runs an operation using the configured operation runner, if there is no configured runner then it uses the DefaultOperationRunner to run the operation.
protected  void runSanityChecks(T options)
          Helper method for running the sanity checks
protected  void runSetup(T options)
          Runs the setup mix (if any) guaranteeing that operations run in precisely the order specified
protected  void runTeardown(T options)
          Runs the tear down mix (if any) guaranteeing that operations run in precisely the order specified
protected  void started(T options)
          Informs all registered progress listeners that the run has started
 
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.runners.Runner
run
 

Constructor Detail

AbstractRunner

public AbstractRunner()
Method Detail

halt

public void halt(T options,
                 String message)
Description copied from interface: Runner
Requests that the run be halted, exact halting conditions and behaviour is specified by the given options

Specified by:
halt in interface Runner<T extends Options>
Parameters:
options - Options
message - Halting Message

halt

public void halt(T options,
                 Exception e)
Description copied from interface: Runner
Requests that the run be halted, exact halting conditions and behaviour is specified by the given options

Specified by:
halt in interface Runner<T extends Options>
Parameters:
options - Options
e - Exception

reportProgress

public void reportProgress(T options)
Description copied from interface: Runner
Reports a newline as a progress message

Specified by:
reportProgress in interface Runner<T extends Options>
Parameters:
options - Options

reportPartialProgress

public void reportPartialProgress(T options,
                                  String message)
Description copied from interface: Runner
Reports progress with an informational message

Messages passed to this function are sent to listeners as-is

Specified by:
reportPartialProgress in interface Runner<T extends Options>
Parameters:
options - Options
message - Informational Message

reportProgress

public void reportProgress(T options,
                           String message)
Description copied from interface: Runner
Reports progress with an informational message

Messages passed to this function will always have a terminating newline character added to them before being sent to listeners

You can configure what happens to the reporting messages by adding ProgressListener instances with the Options.addListener(ProgressListener) method

Specified by:
reportProgress in interface Runner<T extends Options>
Parameters:
options - Options
message - Informational Message

reportBeforeOperation

public void reportBeforeOperation(T options,
                                  Operation operation)
Description copied from interface: Runner
Reports progress before we run an operation

Specified by:
reportBeforeOperation in interface Runner<T extends Options>
Parameters:
options - Options
operation - Operation

reportAfterOperation

public void reportAfterOperation(T options,
                                 Operation operation,
                                 OperationRun run)
Description copied from interface: Runner
Reports progress after we have run an operation

Specified by:
reportAfterOperation in interface Runner<T extends Options>
Parameters:
options - Options
operation - Operation
run - Run information

reportBeforeOperationMix

public void reportBeforeOperationMix(T options,
                                     OperationMix mix)
Description copied from interface: Runner
Reports progress before we run an operation mix

Specified by:
reportBeforeOperationMix in interface Runner<T extends Options>
Parameters:
options - Options
mix - Operation mix

reportAfterOperationMix

public void reportAfterOperationMix(T options,
                                    OperationMix mix,
                                    OperationMixRun run)
Description copied from interface: Runner
Reports progress after we complete a run of the operation mix

Specified by:
reportAfterOperationMix in interface Runner<T extends Options>
Parameters:
options - Options
mix - Operation mix
run - Operation mix run information

checkSanity

protected boolean checkSanity(T options)
Checks that the query endpoint/in-memory dataset being used passes some basic queries to see if it is up and running

May be overridden by runner implementations to change the sanity checking constraints

Parameters:
options - Options
Returns:
Whether the endpoint/in-memory dataset passed some basic sanity checks

getSanityCheckQueries

protected String[] getSanityCheckQueries()
Gets the queries used for sanity checking

Returns:
Sanity checking queries

checkOperations

protected void checkOperations(T options)

runTeardown

protected void runTeardown(T options)
Runs the tear down mix (if any) guaranteeing that operations run in precisely the order specified

Parameters:
options - Options

runSetup

protected void runSetup(T options)
Runs the setup mix (if any) guaranteeing that operations run in precisely the order specified

Parameters:
options - Options

runOp

protected OperationRun runOp(T options,
                             Operation op)
Runs an operation using the configured operation runner, if there is no configured runner then it uses the DefaultOperationRunner to run the operation.

Parameters:
options - Options
op - Operation to run
Returns:
Operation run information

runMix

protected OperationMixRun runMix(T options)
Runs the actual operation mix using the configured operation mix runner, if there is no configured runner then it uses the DefaultOperationMixRunner to run the mix

Parameters:
options - Options
Returns:
Operation Mix run

reportCategorizedErrors

protected void reportCategorizedErrors(T options,
                                       Map<Integer,List<OperationRun>> categorizedErrors)
Reports categorized errors

Parameters:
options - Options
categorizedErrors - Categorized Errors

finished

protected void finished(T options)
Informs all registered progress listeners that the run has finished

Parameters:
options - Options

started

protected void started(T options)
Informs all registered progress listeners that the run has started

Parameters:
options - Options

reportGeneralOptions

protected void reportGeneralOptions(T options)
Reports information about the general options specified

Parameters:
options - Options

reportOperationSummary

protected void reportOperationSummary(T options,
                                      Operation op)
Reports a summary of the operation

Parameters:
options - Options
op - Operation

runSanityChecks

protected void runSanityChecks(T options)
Helper method for running the sanity checks

Parameters:
options - Options


Copyright © 2014. All Rights Reserved.