public abstract class AbstractBenchmarkController extends AbstractPlatformConnectorComponent
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.jena.rdf.model.Model |
benchmarkParamModel
The RDF model containing the benchmark parameters.
|
protected Semaphore |
benchmarkStartSignalMutex
Mutex used to wait for the start signal for this benchmark.
|
protected Set<String> |
dataGenContainerIds
The set of data generator container ids.
|
protected Semaphore |
dataGenReadyMutex
Mutex used to wait for the data generators to be ready.
|
protected Semaphore |
dataGenTerminatedMutex
Mutex used to wait for the data generators to terminate.
|
protected static String |
DEFAULT_EVAL_STORAGE_IMAGE |
protected static String[] |
DEFAULT_EVAL_STORAGE_PARAMETERS |
protected String |
evalModuleContainerId
The container id of the evaluation module.
|
protected Semaphore |
evalModuleTerminatedMutex
Mutex used to wait for the evaluation module to terminate.
|
protected String |
evalStoreContainerId
The container id of the evaluation storage.
|
protected Semaphore |
evalStoreReadyMutex
Mutex used to wait for the evaluation storage to be ready.
|
protected Semaphore |
evalStoreTerminatedMutex
Mutex used to wait for the evaluation storage to terminate.
|
protected String |
experimentUri
The URI of the experiment.
|
private static org.slf4j.Logger |
LOGGER |
protected org.apache.jena.rdf.model.Model |
resultModel
The benchmark result as RDF model received from the evaluation module.
|
protected Semaphore |
resultModelMutex
The benchmark result as RDF model received from the evaluation module.
|
protected Semaphore |
startBenchmarkMutex
Mutex used to wait for the start signal from the controller.
|
protected String |
systemContainerId
The container id of the benchmarked system.
|
protected int |
systemExitCode
The exit code of the system container
|
protected Semaphore |
systemTerminatedMutex
Mutex used to wait for the benchmarked system to terminate.
|
protected Set<String> |
taskGenContainerIds
The set of task generator container ids.
|
protected Semaphore |
taskGenReadyMutex
Mutex used to wait for the task generators to be ready.
|
protected Semaphore |
taskGenTerminatedMutex
Mutex used to wait for the task generators to terminate.
|
cmdChannel, cmdQueueFactory, DEFAULT_CMD_RESPONSE_TIMEOUT, defaultContainerTypeconnectionFactory, incomingDataQueueFactory, NUMBER_OF_RETRIES_TO_CONNECT_TO_RABBIT_MQ, outgoingDataQueuefactory, rabbitMQHostName, START_WAITING_TIME_BEFORE_RETRY| Constructor and Description |
|---|
AbstractBenchmarkController() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addParametersToResultModel()
Adds the
benchmarkParamModel triples to the resultModel
. |
protected void |
containerCrashed(String containerName) |
protected void |
containerTerminated(String containerName,
int exitCode)
This method handles messages from the command bus containing the
information that a container terminated.
|
protected void |
createDataGenerators(String dataGeneratorImageName,
int numberOfDataGenerators,
String[] envVariables)
Creates the given number of data generators using the given image name
and environment variables.
|
protected void |
createEvaluationModule(String evalModuleImageName,
String[] envVariables)
Creates the evaluate module using the given image name and environment
variables.
|
protected void |
createEvaluationStorage()
Creates the default evaluation storage using the given image name and
environment variables.
|
protected void |
createEvaluationStorage(String evalStorageImageName,
String[] envVariables)
Creates the evaluate storage using the given image name and environment
variables.
|
private void |
createGenerator(String generatorImageName,
int numberOfGenerators,
String[] envVariables,
Set<String> generatorIds)
Internal method for creating generator components.
|
protected void |
createTaskGenerators(String taskGeneratorImageName,
int numberOfTaskGenerators,
String[] envVariables)
Creates the given number of task generators using the given image name
and environment variables.
|
protected abstract void |
executeBenchmark() |
protected void |
generateErrorResultModel()
Generates a default model containing an error code and the benchmark
parameters if no result model has been received from the evaluation
module until now.
|
void |
init()
This method initializes the component.
|
void |
receiveCommand(byte command,
byte[] data)
This method is called if a command is received and might be interesting
for this particular component.
|
void |
run()
This method executes the component.
|
protected void |
sendResultModel(org.apache.jena.rdf.model.Model model)
Sends the result RDF model to the platform controller.
|
protected void |
setResultModel(org.apache.jena.rdf.model.Model resultModel)
Uses the given model as result model if the result model is
null. |
protected void |
waitForComponentsToInitialize()
This method waits for the data generators, task generators and evaluation
storage to send their ready signals.
|
protected void |
waitForDataGenToFinish()
Waits for the termination of all data generators.
|
protected void |
waitForEvalComponentsToFinish()
Waits for the termination of the evaluation module and the evaluation
storage.
|
protected void |
waitForSystemToFinish()
This method waits for the benchmarked system to terminate.
|
protected boolean |
waitForSystemToFinish(long maxWaitingTime)
This method waits for the benchmarked system to terminate or times out
after the given amount of time (in milliseconds).
|
protected void |
waitForTaskGenToFinish()
Waits for the termination of all task generators.
|
addContainerObserver, createContainer, getFactoryForIncomingCmdQueues, getFactoryForIncomingDataQueues, getFactoryForOutgoingCmdQueues, getFactoryForOutgoingDataQueues, stopContaineraddCommandHeaderId, close, createContainer, createContainer, handleCmd, sendToCmdQueue, sendToCmdQueue, sendToCmdQueuecreateConnection, generateSessionQueueName, getHobbitSessionIdprivate static final org.slf4j.Logger LOGGER
protected static final String DEFAULT_EVAL_STORAGE_IMAGE
protected static final String[] DEFAULT_EVAL_STORAGE_PARAMETERS
protected org.apache.jena.rdf.model.Model resultModel
protected Semaphore resultModelMutex
protected Semaphore startBenchmarkMutex
protected Semaphore dataGenReadyMutex
protected Semaphore taskGenReadyMutex
protected Semaphore evalStoreReadyMutex
protected Semaphore benchmarkStartSignalMutex
protected Semaphore dataGenTerminatedMutex
protected Semaphore taskGenTerminatedMutex
protected Semaphore systemTerminatedMutex
protected Semaphore evalStoreTerminatedMutex
protected Semaphore evalModuleTerminatedMutex
protected Set<String> dataGenContainerIds
protected Set<String> taskGenContainerIds
protected String evalStoreContainerId
protected String evalModuleContainerId
protected String systemContainerId
protected int systemExitCode
protected org.apache.jena.rdf.model.Model benchmarkParamModel
protected String experimentUri
public void init()
throws Exception
Componentinit in interface Componentinit in class AbstractCommandReceivingComponentException - if an error occurs during the initializationpublic void run()
throws Exception
ComponentException - if an error occurs during the executionprotected void createDataGenerators(String dataGeneratorImageName, int numberOfDataGenerators, String[] envVariables)
dataGeneratorImageName - name of the data generator Docker imagenumberOfDataGenerators - number of generators that should be createdenvVariables - environment variables for the data generatorsprotected void createTaskGenerators(String taskGeneratorImageName, int numberOfTaskGenerators, String[] envVariables)
taskGeneratorImageName - name of the task generator Docker imagenumberOfTaskGenerators - number of generators that should be createdenvVariables - environment variables for the task generatorsprivate void createGenerator(String generatorImageName, int numberOfGenerators, String[] envVariables, Set<String> generatorIds)
generatorImageName - name of the generator Docker imagenumberOfGenerators - number of generators that should be createdenvVariables - environment variables for the task generatorsgeneratorIds - set of generator container namesprotected void createEvaluationModule(String evalModuleImageName, String[] envVariables)
evalModuleImageName - name of the evaluation module imageenvVariables - environment variables that should be given to the moduleprotected void createEvaluationStorage()
protected void createEvaluationStorage(String evalStorageImageName, String[] envVariables)
evalStorageImageName - name of the evaluation storage imageenvVariables - environment variables that should be given to the componentprotected void waitForComponentsToInitialize()
protected void waitForDataGenToFinish()
protected void waitForTaskGenToFinish()
protected boolean waitForSystemToFinish(long maxWaitingTime)
maxWaitingTime - maximum waiting time in millisecondstrue if the system has been terminated or false
if the method timed outprotected void waitForSystemToFinish()
protected void waitForEvalComponentsToFinish()
protected void setResultModel(org.apache.jena.rdf.model.Model resultModel)
null. Else, the two models are merged.resultModel - the new result modelprotected void generateErrorResultModel()
protected void addParametersToResultModel()
benchmarkParamModel triples to the resultModel
.protected void sendResultModel(org.apache.jena.rdf.model.Model model)
model - model containing the resultspublic void receiveCommand(byte command,
byte[] data)
CommandReceivingComponentreceiveCommand in interface CommandReceivingComponentreceiveCommand in class AbstractPlatformConnectorComponentcommand - the byte encoding the commanddata - additional data that was sent together with the commandprotected void containerTerminated(String containerName, int exitCode)
containerName - the name of the terminated containerexitCode - the exit code of the terminated containerprotected void containerCrashed(String containerName)
Copyright © 2017–2018. All rights reserved.