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