LOG.info("Trying to cancel job with ID " + jobID);
final ExecutionGraph eg = this.currentJobs.get(jobID);
if (eg == null) {
LOG.info("No job found with ID " + jobID);
return new JobCancelResult(ReturnCode.ERROR, "Cannot find job with ID " + jobID);
}
final Runnable cancelJobRunnable = new Runnable() {
@Override
public void run() {
eg.cancel();
}
};
eg.execute(cancelJobRunnable);
return new JobCancelResult(AbstractJobResult.ReturnCode.SUCCESS, null);
}