Commit 7965ada1 authored by Daniel Seybold's avatar Daniel Seybold

fixed issues in tsbs api that cause compile errors, looging needs to be more expressive

parent 95d44b12
Pipeline #64900 passed with stage
in 16 minutes and 17 seconds
......@@ -151,7 +151,7 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
@Override
public Response workloadTsbsLoadPost(String taskId, TSBSLoadWorkload workload,
SecurityContext securityContext) throws NotFoundException, IOException, InterruptedException {
SecurityContext securityContext) throws NotFoundException {
//check if already a workloadProcess running
......@@ -179,10 +179,19 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
generateDataCommand += " | gzip > " + resultFileName;
ProcessBuilder genDataProcess= new ProcessBuilder();
genDataProcess.command(UNIX_SHELL, UNIX_COMMAND_PARAM, generateDataCommand);
Process processData = genDataProcess.start();
Process processData = null;
try {
processData = genDataProcess.start();
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(generateDataCommand);
while (processData.isAlive()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("finished data generation");
......@@ -200,9 +209,18 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
System.out.println(generateQueriesCommand);
ProcessBuilder genQueryProcess = new ProcessBuilder();
genQueryProcess.command(UNIX_SHELL, UNIX_COMMAND_PARAM, generateQueriesCommand);
Process processGenQueries = genQueryProcess.start();
Process processGenQueries = null;
try {
processGenQueries = genQueryProcess.start();
} catch (IOException e) {
e.printStackTrace();
}
while (processGenQueries.isAlive()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("finished query generation");
......@@ -214,10 +232,19 @@ public class WorkloadApiServiceImpl extends WorkloadApiService {
System.out.println(loadCommand);
ProcessBuilder loadProcess = new ProcessBuilder();
loadProcess.command(UNIX_SHELL, UNIX_COMMAND_PARAM, loadCommand);
Process processLoad = loadProcess.start();
Process processLoad = null;
try {
processLoad = loadProcess.start();
} catch (IOException e) {
e.printStackTrace();
}
while (processLoad.isAlive()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
System.out.println("finished loading");
// Execute Queries
......
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