JobGraph job = getJobGraph(compiledPlan, libraries);
return run(job, wait);
}
public JobExecutionResult run(JobGraph jobGraph, boolean wait) throws ProgramInvocationException {
JobClient client;
try {
client = new JobClient(jobGraph, configuration, this.userCodeClassLoader);
}
catch (IOException e) {
throw new ProgramInvocationException("Could not open job manager: " + e.getMessage());
}
client.setConsoleStreamForReporting(this.printStatusDuringExecution ? System.out : null);
try {
if (wait) {
return client.submitJobAndWait();
}
else {
JobSubmissionResult result = client.submitJob();
if (result.getReturnCode() != ReturnCode.SUCCESS) {
throw new ProgramInvocationException("The job was not successfully submitted to the nephele job manager"
+ (result.getDescription() == null ? "." : ": " + result.getDescription()));
}