@@ -156,40 +156,38 @@ public void init() throws Exception {
156156
157157 @ Override
158158 public void run () throws Exception {
159- sendToCmdQueue (Commands .BENCHMARK_READY_SIGNAL );
160- // wait for the start signal
161- startBenchmarkMutex .acquire ();
162- executeBenchmark ();
159+ try {
160+ sendToCmdQueue (Commands .BENCHMARK_READY_SIGNAL );
161+ // wait for the start signal
162+ startBenchmarkMutex .acquire ();
163+ executeBenchmark ();
164+ } catch (Exception e ) {
165+ throw reportAndWrap (e );
166+ }
163167 }
164168
165169 protected abstract void executeBenchmark () throws Exception ;
166170
167171 /**
168- * Creates the given number of data generators using the given image name
169- * and environment variables.
172+ * Creates the given number of data generators using the given image name and
173+ * environment variables.
170174 *
171- * @param dataGeneratorImageName
172- * name of the data generator Docker image
173- * @param numberOfDataGenerators
174- * number of generators that should be created
175- * @param envVariables
176- * environment variables for the data generators
175+ * @param dataGeneratorImageName name of the data generator Docker image
176+ * @param numberOfDataGenerators number of generators that should be created
177+ * @param envVariables environment variables for the data generators
177178 */
178179 protected void createDataGenerators (String dataGeneratorImageName , int numberOfDataGenerators ,
179180 String [] envVariables ) {
180181 createGenerator (dataGeneratorImageName , numberOfDataGenerators , envVariables , dataGenContainerIds );
181182 }
182183
183184 /**
184- * Creates the given number of task generators using the given image name
185- * and environment variables.
185+ * Creates the given number of task generators using the given image name and
186+ * environment variables.
186187 *
187- * @param taskGeneratorImageName
188- * name of the task generator Docker image
189- * @param numberOfTaskGenerators
190- * number of generators that should be created
191- * @param envVariables
192- * environment variables for the task generators
188+ * @param taskGeneratorImageName name of the task generator Docker image
189+ * @param numberOfTaskGenerators number of generators that should be created
190+ * @param envVariables environment variables for the task generators
193191 */
194192 protected void createTaskGenerators (String taskGeneratorImageName , int numberOfTaskGenerators ,
195193 String [] envVariables ) {
@@ -199,14 +197,10 @@ protected void createTaskGenerators(String taskGeneratorImageName, int numberOfT
199197 /**
200198 * Internal method for creating generator components.
201199 *
202- * @param generatorImageName
203- * name of the generator Docker image
204- * @param numberOfGenerators
205- * number of generators that should be created
206- * @param envVariables
207- * environment variables for the task generators
208- * @param generatorIds
209- * set of generator container names
200+ * @param generatorImageName name of the generator Docker image
201+ * @param numberOfGenerators number of generators that should be created
202+ * @param envVariables environment variables for the task generators
203+ * @param generatorIds set of generator container names
210204 */
211205 private void createGenerator (String generatorImageName , int numberOfGenerators , String [] envVariables ,
212206 Set <String > generatorIds ) {
@@ -216,7 +210,8 @@ private void createGenerator(String generatorImageName, int numberOfGenerators,
216210 // NOTE: Count only includes generators created within this method call.
217211 variables [variables .length - 2 ] = Constants .GENERATOR_COUNT_KEY + "=" + numberOfGenerators ;
218212 for (int i = 0 ; i < numberOfGenerators ; ++i ) {
219- // At the start generatorIds is empty, and new generators are added to it immediately.
213+ // At the start generatorIds is empty, and new generators are added to it
214+ // immediately.
220215 // Current size of that set is used to make IDs for new generators.
221216 variables [variables .length - 1 ] = Constants .GENERATOR_ID_KEY + "=" + generatorIds .size ();
222217 containerId = createContainer (generatorImageName , variables );
@@ -234,10 +229,9 @@ private void createGenerator(String generatorImageName, int numberOfGenerators,
234229 * Creates the evaluate module using the given image name and environment
235230 * variables.
236231 *
237- * @param evalModuleImageName
238- * name of the evaluation module image
239- * @param envVariables
240- * environment variables that should be given to the module
232+ * @param evalModuleImageName name of the evaluation module image
233+ * @param envVariables environment variables that should be given to the
234+ * module
241235 */
242236 protected void createEvaluationModule (String evalModuleImageName , String [] envVariables ) {
243237 envVariables = ArrayUtils .add (envVariables , Constants .HOBBIT_EXPERIMENT_URI_KEY + "=" + experimentUri );
@@ -263,10 +257,9 @@ protected void createEvaluationStorage() {
263257 * Creates the evaluate storage using the given image name and environment
264258 * variables.
265259 *
266- * @param evalStorageImageName
267- * name of the evaluation storage image
268- * @param envVariables
269- * environment variables that should be given to the component
260+ * @param evalStorageImageName name of the evaluation storage image
261+ * @param envVariables environment variables that should be given to the
262+ * component
270263 */
271264 protected void createEvaluationStorage (String evalStorageImageName , String [] envVariables ) {
272265 evalStoreContainerId = createContainer (evalStorageImageName , Constants .CONTAINER_TYPE_DATABASE , envVariables );
@@ -353,13 +346,12 @@ protected void waitForTaskGenToFinish() {
353346 }
354347
355348 /**
356- * This method waits for the benchmarked system to terminate or times out
357- * after the given amount of time (in milliseconds).
349+ * This method waits for the benchmarked system to terminate or times out after
350+ * the given amount of time (in milliseconds).
358351 *
359- * @param maxWaitingTime
360- * maximum waiting time in milliseconds
361- * @return {@code true} if the system has been terminated or {@code false}
362- * if the method timed out
352+ * @param maxWaitingTime maximum waiting time in milliseconds
353+ * @return {@code true} if the system has been terminated or {@code false} if
354+ * the method timed out
363355 */
364356 protected boolean waitForSystemToFinish (long maxWaitingTime ) {
365357 LOGGER .debug ("Waiting for the benchmarked system to finish." );
@@ -422,8 +414,7 @@ protected void waitForEvalComponentsToFinish() {
422414 * Uses the given model as result model if the result model is
423415 * <code>null</code>. Else, the two models are merged.
424416 *
425- * @param resultModel
426- * the new result model
417+ * @param resultModel the new result model
427418 */
428419 protected void setResultModel (Model resultModel ) {
429420 try {
@@ -445,9 +436,9 @@ protected void setResultModel(Model resultModel) {
445436
446437 /**
447438 * Generates a default model containing an error code and the benchmark
448- * parameters if no result model has been received from the evaluation
449- * module until now. If the model already has been received, the error is
450- * added to the existing model.
439+ * parameters if no result model has been received from the evaluation module
440+ * until now. If the model already has been received, the error is added to the
441+ * existing model.
451442 */
452443 protected void generateErrorResultModel () {
453444 try {
@@ -469,8 +460,7 @@ protected void generateErrorResultModel() {
469460 }
470461
471462 /**
472- * Adds the {@link #benchmarkParamModel} triples to the {@link #resultModel}
473- * .
463+ * Adds the {@link #benchmarkParamModel} triples to the {@link #resultModel} .
474464 */
475465 protected void addParametersToResultModel () {
476466 try {
@@ -480,8 +470,7 @@ protected void addParametersToResultModel() {
480470 }
481471 try {
482472 Resource experimentResource = resultModel .getResource (experimentUri );
483- StmtIterator iterator = benchmarkParamModel .listStatements (
484- HobbitExperiments .New , null , (RDFNode ) null );
473+ StmtIterator iterator = benchmarkParamModel .listStatements (HobbitExperiments .New , null , (RDFNode ) null );
485474 Statement statement ;
486475 while (iterator .hasNext ()) {
487476 statement = iterator .next ();
@@ -495,8 +484,7 @@ protected void addParametersToResultModel() {
495484 /**
496485 * Sends the result RDF model to the platform controller.
497486 *
498- * @param model
499- * model containing the results
487+ * @param model model containing the results
500488 */
501489 protected void sendResultModel (Model model ) {
502490 try {
@@ -558,14 +546,12 @@ public void receiveCommand(byte command, byte[] data) {
558546 }
559547
560548 /**
561- * This method handles messages from the command bus containing the
562- * information that a container terminated. It checks whether the container
563- * belongs to the current benchmark and whether it has to react.
549+ * This method handles messages from the command bus containing the information
550+ * that a container terminated. It checks whether the container belongs to the
551+ * current benchmark and whether it has to react.
564552 *
565- * @param containerName
566- * the name of the terminated container
567- * @param exitCode
568- * the exit code of the terminated container
553+ * @param containerName the name of the terminated container
554+ * @param exitCode the exit code of the terminated container
569555 */
570556 protected void containerTerminated (String containerName , int exitCode ) {
571557 if (dataGenContainerIds .contains (containerName )) {
0 commit comments