Commit 9823ab0e authored by Julia Abramenko's avatar Julia Abramenko

- deleted parameter in executeQueries(), not necessary

parent c680dc5b
Pipeline #60537 failed with stage
in 14 minutes and 25 seconds
......@@ -222,7 +222,7 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
// Execute Queries
String exeQueries = "cat " + queriesToExecute + " | gunzip | ";
exeQueries += TSBSCommandBuilder.executeQueries(workload.getTsbsDataConfig(), workload.getTsbsQueryExecution(), queriesToExecute);
exeQueries += TSBSCommandBuilder.executeQueries(workload.getTsbsDataConfig(), workload.getTsbsQueryExecution()/*, queriesToExecute*/);
exeQueries += " > " + TSBS_RESULT_FOLDER + "query_execution.csv";
System.out.println(exeQueries);
workloadProcess
......
......@@ -42,15 +42,7 @@ public class TSBSCommandBuilder {
else fail=true;
if (dataConfig.getFormat() != null) {
generateDataCommand += "-format=\"" + dataConfig.getFormat()+ "\"";
}
else fail=true;
System.out.println(generateDataCommand);
// save resulting output in a gzip file
//assert dataConfig.getFormat() != null;
//generateDataCommand += "| gzip > " + tsbsResultFolder + dataConfig.getFormat() + "-data.gz";
} else fail=true;
if (fail) {
LOGGER.error("Required arguments are missing\n" + "One of the following:");
LOGGER.info("Arguments needed: \n" +
......@@ -96,7 +88,6 @@ public class TSBSCommandBuilder {
if(queryConfig.getFormat() != null) {
generateQueryCommand += "-format=" + "\"" + queryConfig.getFormat() + "\" ";
} else fail = true;
System.out.println(generateQueryCommand);
if (fail) {
LOGGER.error("Required arguments are missing\n" + "One of the following:");
LOGGER.info("Arguments needed: \n" +
......@@ -113,7 +104,7 @@ public class TSBSCommandBuilder {
else return generateQueryCommand;
}
@Deprecated
public static String loadCommand(TSBSDataConfig dataConfig, TSBSLoadConfig loadConfig, String fileToLoad) {
checkNotNull(dataConfig);
boolean fail = false;
......@@ -131,7 +122,6 @@ public class TSBSCommandBuilder {
}
} else fail = true;
loadingCommand += "-file=" + "\"" + fileToLoad + "\"";
System.out.println(loadingCommand);
if (fail) {
LOGGER.error("Loading command cannot be executed.");
return "";
......@@ -140,23 +130,42 @@ public class TSBSCommandBuilder {
}
public static String executeQueries(TSBSDataConfig dataConfig, TSBSQueryExecution quExe, String queriesToExecute) {
String exeQueries = "tsbs_load_" + dataConfig.getFormat() + " ";
public static String measurePerformance(TSBSDataConfig dataConfig, TSBSLoadConfig loadConfig, String TSBSResultFolder, String ScriptFolder) {
checkNotNull(dataConfig);
checkNotNull(loadConfig);
String loadingCommand = "";
boolean fail=false;
if(loadConfig.getNumberOfWorkers().intValue() > 0 ) {
loadingCommand += "NUM_WORKERS=" + loadConfig.getNumberOfWorkers() + " ";
} else fail=true;
if(loadConfig.getBatchSize().intValue() > 0) {
loadingCommand += "BATCH_SIZE=" + loadConfig.getBatchSize() + " ";
} else fail=true;
loadingCommand += "BULK_DATA_DIR=" + TSBSResultFolder + " ";
loadingCommand += ScriptFolder + "load_" + dataConfig.getFormat() + ".sh";
if (fail) {
LOGGER.error("Loading command cannot be executed.");
return "";
}
else return loadingCommand;
}
public static String executeQueries(TSBSDataConfig dataConfig, TSBSQueryExecution quExe/*, String queriesToExecute*/) {
String exeQueries = "tsbs_run_queries_" + dataConfig.getFormat() + " ";
boolean fail=false;
if(quExe.getWorkers().intValue() > 0) {
exeQueries += "-workers=" + quExe.getWorkers() + " ";
exeQueries += "--workers=" + quExe.getWorkers() + " ";
} else fail = true;
if(quExe.getDbmsPorperties().size() > 0 ) {
for(TSDBMSDBMSProperties prop : quExe.getDbmsPorperties()) {
exeQueries += prop.getName() + "=\"" + prop.getValue() + "\" ";
}
} else fail = true;
System.out.println(exeQueries);
if (fail) {
LOGGER.error("Query execution cannot be executed.");
return "";
}else {
exeQueries += "-file=" + "\"" + queriesToExecute + "\"";
//exeQueries += "-file=" + "\"" + queriesToExecute + "\"";
return exeQueries;
}
......
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