T
- public abstract class AbstractRunner<T extends Options> extends Object implements Runner<T>
Constructor and Description |
---|
AbstractRunner() |
Modifier and Type | Method and Description |
---|---|
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
|
public void halt(T options, String message)
Runner
public void halt(T options, Exception e)
Runner
public void reportProgress(T options)
Runner
reportProgress
in interface Runner<T extends Options>
options
- Optionspublic void reportPartialProgress(T options, String message)
Runner
Messages passed to this function are sent to listeners as-is
reportPartialProgress
in interface Runner<T extends Options>
options
- Optionsmessage
- Informational Messagepublic void reportProgress(T options, String message)
Runner
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
reportProgress
in interface Runner<T extends Options>
options
- Optionsmessage
- Informational Messagepublic void reportBeforeOperation(T options, Operation operation)
Runner
reportBeforeOperation
in interface Runner<T extends Options>
options
- Optionsoperation
- Operationpublic void reportAfterOperation(T options, Operation operation, OperationRun run)
Runner
reportAfterOperation
in interface Runner<T extends Options>
options
- Optionsoperation
- Operationrun
- Run informationpublic void reportBeforeOperationMix(T options, OperationMix mix)
Runner
reportBeforeOperationMix
in interface Runner<T extends Options>
options
- Optionsmix
- Operation mixpublic void reportAfterOperationMix(T options, OperationMix mix, OperationMixRun run)
Runner
reportAfterOperationMix
in interface Runner<T extends Options>
options
- Optionsmix
- Operation mixrun
- Operation mix run informationprotected boolean checkSanity(T options)
May be overridden by runner implementations to change the sanity checking constraints
options
- Optionsprotected String[] getSanityCheckQueries()
protected void checkOperations(T options)
protected void runTeardown(T options)
options
- Optionsprotected void runSetup(T options)
options
- Optionsprotected OperationRun runOp(T options, Operation op)
DefaultOperationRunner
to run
the operation.options
- Optionsop
- Operation to runprotected OperationMixRun runMix(T options)
DefaultOperationMixRunner
to run the mixoptions
- Optionsprotected void reportCategorizedErrors(T options, Map<Integer,List<OperationRun>> categorizedErrors)
options
- OptionscategorizedErrors
- Categorized Errorsprotected void finished(T options)
options
- Optionsprotected void started(T options)
options
- Optionsprotected void reportGeneralOptions(T options)
options
- Optionsprotected void reportOperationSummary(T options, Operation op)
options
- Optionsop
- Operationprotected void runSanityChecks(T options)
options
- OptionsCopyright © 2015. All rights reserved.