Commit 64f04538 authored by Daniel Seybold's avatar Daniel Seybold

fixed mongodb single node bug and added slightly better error handling

parent 9c830803
Pipeline #51833 passed with stage
in 11 minutes and 31 seconds
......@@ -26,6 +26,8 @@ import de.uulm.omi.evaluation.scenario.ScalabilityYCSBWriteScenario;
import javax.validation.constraints.NotNull;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.SecurityContext;
import org.jeasy.flows.work.WorkReport;
import org.jeasy.flows.work.WorkStatus;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -132,10 +134,15 @@ public class ScenarioApiServiceImpl extends ScenarioApiService {
PerformanceYCSBMultiPhaseScenario performanceYCSBMultiPhaseScenario = new PerformanceYCSBMultiPhaseScenario(scenarioType,cloud,dbmsType,
dbmsConfiguration,runs, scenarioSpec,cleanUp.booleanValue());
performanceYCSBMultiPhaseScenario.execute();
WorkReport workReport = performanceYCSBMultiPhaseScenario.execute();
if(workReport.getStatus().equals(WorkStatus.COMPLETED)){
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "Performance YCSB multi-phase evaluation finished!")).build();
}else{
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.ERROR, "Performance YCSB multi-phase evaluation failed! Please check the portainer logs!")).build();
}
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "Performance YCSB multi-phase evaluation finished!")).build();
}
@Override
......@@ -147,9 +154,13 @@ public class ScenarioApiServiceImpl extends ScenarioApiService {
PerformanceYCSBWriteScenario performanceYCSBWrite = new PerformanceYCSBWriteScenario(scenarioType,cloud,dbmsType,
dbmsConfiguration,runs, scenarioSpec,cleanUp.booleanValue());
performanceYCSBWrite.execute();
WorkReport workReport = performanceYCSBWrite.execute();
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "Performance YCSB write evaluation finished!")).build();
if(workReport.getStatus().equals(WorkStatus.COMPLETED)){
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "Performance YCSB write evaluation finished!")).build();
}else{
return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.ERROR, "Performance YCSB write evaluation failed! Please check the portainer logs!")).build();
}
}
/**
......
......@@ -54,7 +54,7 @@ public class AvailabilityYCSBMultiPhaseScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
InitEvaluation initEvaluationTask = new InitEvaluation(this.evaluationContext);
......@@ -188,6 +188,8 @@ public class AvailabilityYCSBMultiPhaseScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -56,7 +56,7 @@ public class AvailabilityYCSBWriteScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
/**
* init general result folders and counters
......@@ -208,5 +208,7 @@ public class AvailabilityYCSBWriteScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -57,7 +57,7 @@ public class ElasticityYCSBMultiPhaseScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
/**
**************************** Deployment *********************************************
......@@ -227,5 +227,7 @@ public class ElasticityYCSBMultiPhaseScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -57,7 +57,7 @@ public class ElasticityYCSBWriteScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
/**
**************************** Deployment *********************************************
......@@ -216,5 +216,7 @@ public class ElasticityYCSBWriteScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
package de.uulm.omi.evaluation.scenario;
import org.jeasy.flows.work.WorkReport;
/**
* Created by Daniel Seybold on 09.05.2018.
*/
public interface EvaluationScenarioService {
public void execute();
public WorkReport execute();
}
......@@ -53,7 +53,7 @@ public class NoiseyNeighbour extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
......@@ -138,5 +138,7 @@ public class NoiseyNeighbour extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -50,7 +50,7 @@ public class PerformanceYCSBMultiPhaseScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
InitEvaluation initEvaluationTask = new InitEvaluation(this.evaluationContext);
......@@ -158,5 +158,9 @@ public class PerformanceYCSBMultiPhaseScenario extends EvaluationScenario {
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -52,7 +52,7 @@ public class PerformanceYCSBWriteScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
InitEvaluation initEvaluationTask = new InitEvaluation(this.evaluationContext);
......@@ -129,6 +129,8 @@ public class PerformanceYCSBWriteScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -49,7 +49,7 @@ public class ScalabilityTPCCScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
InitEvaluation initEvaluationTask = new InitEvaluation(this.evaluationContext);
......@@ -131,6 +131,8 @@ public class ScalabilityTPCCScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
\ No newline at end of file
......@@ -50,7 +50,7 @@ public class ScalabilityYCSBMultiPhaseScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
InitEvaluation initEvaluationTask = new InitEvaluation(this.evaluationContext);
......@@ -154,6 +154,7 @@ public class ScalabilityYCSBMultiPhaseScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -50,7 +50,7 @@ public class ScalabilityYCSBWriteScenario extends EvaluationScenario {
}
@Override
public void execute() {
public WorkReport execute() {
InitEvaluation initEvaluationTask = new InitEvaluation(this.evaluationContext);
......@@ -141,5 +141,7 @@ public class ScalabilityYCSBWriteScenario extends EvaluationScenario {
WorkFlowEngine workFlowEngine = aNewWorkFlowEngine().build();
WorkReport workReport = workFlowEngine.run(sensorStorageWorkFlow);
return workReport;
}
}
......@@ -250,7 +250,7 @@ public class Plotting extends EvaluationTask {
//build endpoints
List<String> endpoints = ColosseumUtils.getEndpoints(appInstanceId, "PUBLIC", DBMSNodeType.ALL);
if(endpoints.size() == 0){
LOGGER.warn(loggerPrefix + "Found no endpoints for cluster with ApplicationInstanceId: " + this.clusterContext.getIdApplicationInstance() +" ! Aborting!");
LOGGER.warn(loggerPrefix + "Found no endpoints for DBMS with ApplicationInstanceId: " + this.clusterContext.getIdApplicationInstance() +" ! Aborting!");
}
return endpoints;
......
......@@ -64,7 +64,12 @@ public class YcsbWorkload extends EvaluationTask {
//build endpoints
DBEndpoints dbEndpoints = null;
if(ycsbWorkload.getDatabaseConfig().getDatabaseBinding().equals(DatabaseBindingEnum.MONGODB)){
//distinguish between single instance and cluster: if management node available = cluster otherwise single node
dbEndpoints = ColosseumUtils.extractDBEndpoints(appInstanceId, this.network.getType().toString(), DBMSNodeType.MANAGEMENT);
if(dbEndpoints.isEmpty()){
LOGGER.warn(loggerPrefix + "Did not find any endpoints for MongoDB management node, now looking for MongoDB seed node of a single node cluster!");
dbEndpoints = ColosseumUtils.extractDBEndpoints(appInstanceId, this.network.getType().toString(), DBMSNodeType.SEED);
}
}else {
dbEndpoints = ColosseumUtils.extractDBEndpoints(appInstanceId, this.network.getType().toString(), DBMSNodeType.ALL);
}
......
......@@ -92,7 +92,7 @@ public class ColosseumUtils {
DBEndpoints dbEndpoints = new DBEndpoints();
List<String> endpoints = ColosseumUtils.getEndpoints(appInstanceId, networkType, dbmsNodeType);
if(endpoints.size() == 0){
LOGGER.warn("Found no endpoints for applicationInstanceId! ");
LOGGER.warn("Found no endpoints while fetching endpoint from Colosseum for applicationInstanceId: " + appInstanceId + " and network type: " + networkType + " node type: " + dbmsNodeType);
}else{
for (String endpoint: endpoints) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment