Commit 40eb41a2 authored by Daniel Seybold's avatar Daniel Seybold

applied more fixes

parent 2edce963
......@@ -45,10 +45,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
//TSBS constants
private final String TSBS_DATA_FOLDER = "TSBS/"; // TODO CHANGE
private final String TSBS_RESULT_FOLDER = "TSBS/"; // TODO CHANGE
private final String TSBS_RESULT_FOLDER = "TSBS/";
private static final String TSBS_BINARY = "/opt/workloads/tsbs/bin/";
private static final String TSBS_SCRIPTS = "/opt/workloads/tsbs/src/github.com/timescale/tsbs/scripts/";
......@@ -230,7 +228,7 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
LOGGER.debug("Satarting phase 1: data generations");
String generateDataCommand= "";
generateDataCommand = TSBSCommandBuilder.generateDataCommand( TSBS_BINARY, workload.getDbms(), workload.getTsbsDataGeneration());
generateDataCommand += TSBS_DATA_FOLDER + workload.getDbms().toString() + "-data.gz";
generateDataCommand += properties.getProperty(WorkloadApiProperties.WORKLOAD_DATA_FOLDER) + workload.getDbms().toString() + "-data.gz";
LOGGER.debug("Generate data command: " + generateDataCommand);
ProcessBuilder genDataProcess= new ProcessBuilder();
......@@ -257,7 +255,7 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
String generateQueriesCommand = "";
generateQueriesCommand = TSBSCommandBuilder.generateQueriesCommand(TSBS_BINARY, workload.getDbms(), workload.getTsbsDataGeneration(), workload.getTsbsQueryGeneration());
generateQueriesCommand += TSBS_DATA_FOLDER + workload.getDbms().toString() + "-queries.gz" ;
generateQueriesCommand += properties.getProperty(WorkloadApiProperties.WORKLOAD_DATA_FOLDER) + workload.getDbms().toString() + "-queries.gz" ;
LOGGER.debug(generateQueriesCommand);
......@@ -285,6 +283,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
String clearDBCommand = TSBSCommandBuilder.clearDB(workload.getDbms(), workload.getTsbsLoadExecution().getDbName(),workload.getDbEndpoints());
ProcessBuilder processClearDBBuilder = new ProcessBuilder();
processClearDBBuilder.command(UNIX_SHELL, UNIX_COMMAND_PARAM, clearDBCommand);
LOGGER.debug(clearDBCommand);
Process clearDBProcess = null;
try {
clearDBProcess = processClearDBBuilder.start();
......@@ -303,8 +303,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
String loadCommand = "";
loadCommand = TSBSCommandBuilder.generateLoadCommand(TSBS_BINARY, workload.getDbms(), workload.getTsbsLoadExecution(),workload.getDbEndpoints());
loadCommand += " > " + TSBS_RESULT_FOLDER + taskId.trim() + "_load.txt";
loadCommand = TSBSCommandBuilder.generateLoadCommand(TSBS_BINARY, WorkloadApiProperties.WORKLOAD_DATA_FOLDER, workload.getDbms(), workload.getTsbsLoadExecution(),workload.getDbEndpoints());
loadCommand += " > " + properties.getProperty(WorkloadApiProperties.WORKLOAD_RESULTS_FOLDER) + TSBS_RESULT_FOLDER + taskId.trim() + "_load.txt";
LOGGER.debug(loadCommand);
......@@ -329,8 +329,8 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
//Phase 4: executing query phase
//Execute Queries
String executeQueriesCommand = TSBSCommandBuilder.executeQueriesCommand(TSBS_BINARY, TSBS_DATA_FOLDER, workload.getDbms(), workload.getTsbsQueryExecution(), workload.getDbEndpoints() );
executeQueriesCommand += " > " + TSBS_RESULT_FOLDER + taskId.trim() + ".txt";
String executeQueriesCommand = TSBSCommandBuilder.executeQueriesCommand(TSBS_BINARY, properties.getProperty(WorkloadApiProperties.WORKLOAD_DATA_FOLDER), workload.getDbms(), workload.getTsbsQueryExecution(), workload.getDbEndpoints() );
executeQueriesCommand += " > " + properties.getProperty(WorkloadApiProperties.WORKLOAD_RESULTS_FOLDER) + TSBS_RESULT_FOLDER + taskId.trim() + ".txt";
LOGGER.debug(loadCommand);
......
......@@ -64,6 +64,7 @@ public enum WorkloadApiProperties implements WorkloadApiPropertiesService {
//property keys
public static final String WORKLOAD_BINARIES_FOLDER = "workloadBinariesFolder";
public static final String WORKLOAD_RESULTS_FOLDER = "workloadResultsFolder";
public static final String WORKLOAD_DATA_FOLDER = "workloadDataFolder";
private static final Logger LOGGER = LoggerFactory.getLogger(WorkloadProcess.class.getName());
......
......@@ -19,7 +19,7 @@ public class TSBSCommandBuilder {
private static final Logger LOGGER = LoggerFactory.getLogger(TSBSCommandBuilder.class);
private static String DEFAULT_INFLUX_URLS="http://localhost:8086";
private static String DEFAULT_INFLUX_URLS="http://localhost:8086 ";
private static String DEFAULT_INFLUX_BACKOFF="1s";
private static String DEFAULT_INFLUX_CONSISTENCY="all";
private static String DEFAULT_INFLUX_REPLICATION_FACTOR="1";
......@@ -139,7 +139,7 @@ public class TSBSCommandBuilder {
public static String generateLoadCommand(String binaryPath, DbmsEnum dbms,
public static String generateLoadCommand(String binaryPath, String dataFolder, DbmsEnum dbms,
TSBSLoadExecution tsbsLoadExecution,
DBEndpoints dbEndpoints) {
......@@ -148,7 +148,7 @@ public class TSBSCommandBuilder {
String generateLoadCommand = binaryPath + "tsbs_load_" + dbms.toString() + " ";
String generateLoadCommand = "cat " + dataFolder + dbms.toString() + "-data.gz | gunzip | " + binaryPath + "tsbs_load_" + dbms.toString() + " ";
//common parameters
if (tsbsLoadExecution.getDbName() != null){
......@@ -242,10 +242,10 @@ public class TSBSCommandBuilder {
Optional<TSDBMSDBMSProperties> item = dbmsProperties.stream()
.filter(c -> c.getName().equals("backoff")).findAny();
influxCommand += "--backoff " + item.get().getValue();
influxCommand += "--backoff " + item.get().getValue() + " ";
}else{
influxCommand += " --backoff " + DEFAULT_INFLUX_BACKOFF;
influxCommand += " --backoff " + DEFAULT_INFLUX_BACKOFF + " ";
}
......@@ -268,10 +268,10 @@ public class TSBSCommandBuilder {
Optional<TSDBMSDBMSProperties> item = dbmsProperties.stream()
.filter(c -> c.getName().equals("replication-factor")).findAny();
influxCommand += "--replication-factor " + item.get().getValue();
influxCommand += "--replication-factor " + item.get().getValue() + " ";
}else{
influxCommand += " --replication-factor " + DEFAULT_INFLUX_REPLICATION_FACTOR;
influxCommand += " --replication-factor " + DEFAULT_INFLUX_REPLICATION_FACTOR + " ";
}
......@@ -284,7 +284,7 @@ public class TSBSCommandBuilder {
String clearCommand = "";
if(dbms.equals(DbmsEnum.INFLUX)){
clearCommand = "curl -X POST http://" + dbEndpoints.get(0) + ":8086/query?q=drop%20database%20" + databaseName;
clearCommand = " curl -X POST http://" + dbEndpoints.get(0) + ":8086/query?q=drop%20database%20" + databaseName;
return clearCommand;
}
......
debugFlag=false
workloadBinariesFolder=/opt/workloads/
workloadResultsFolder=/opt/results/
\ No newline at end of file
workloadResultsFolder=/opt/results/
workloadDataFolder=/opt/workloads/data/
\ No newline at end of file
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