public void generateBinaries() throws Exception {
Location rootTmpDir = Locations.getParent(Locations.getParent(dir));
Location shell = new LocalLocationFactory(new File("/")).create("/").append("bin").append("sh");
ExternalProgramExecutor copyGSEXIT = new ExternalProgramExecutor("Copy GSEXIT", dir, shell, "-c",
"cp ../../bin/gsexit ./GSEXIT");
copyGSEXIT.startAndWait();
LOG.info("Copying GSEXIT: {}", copyGSEXIT);
Services.getCompletionFuture(copyGSEXIT).get(20, TimeUnit.SECONDS);
if (copyGSEXIT.getExitCode() != 0) {
throw new RuntimeException("Stream Engine Binary Failed - GSEXIT copy failed");
}
ExternalProgramExecutor executorService = new ExternalProgramExecutor(
"GENBINS", dir, shell, "-c",
"../../bin/translate_fta -h localhost -c -S -M -C . packet_schema.txt " + Constants.GSQL_FILE);
LOG.info("Starting GENBINS : {}", executorService);
executorService.startAndWait();
Services.getCompletionFuture(executorService).get(20, TimeUnit.SECONDS);
if (executorService.getExitCode() != 0) {
throw new RuntimeException("Stream Engine Binary BUILD Failed");
}
ExternalProgramExecutor makeService = new ExternalProgramExecutor(
"GENBINS", dir, shell, "-c", "make");
LOG.info("Starting MAKE : {}", executorService);
makeService.startAndWait();
Services.getCompletionFuture(makeService).get(20, TimeUnit.SECONDS);
if (makeService.getExitCode() != 0) {
throw new RuntimeException("Stream Engine Binary MAKE Failed");
}
}