@Override public boolean stopExecution(ExecutionContext context, int exeId) { lastErrorMsg = ""; SamzaSqlApplicationRunner runner = executions.get(exeId); if (runner != null) { LOG.debug("Stopping execution ", exeId); try { runner.kill(); } catch (SamzaException ex) { String msg = "Stopping execution failed with exception "; lastErrorMsg = msg + ex.toString(); LOG.warn(msg, ex); return false; } try { Thread.sleep(500); // wait for a second } catch (InterruptedException e) { e.printStackTrace(); } return true; } else { lastErrorMsg = "Trying to stop a non-existing SQL execution " + exeId; LOG.warn(lastErrorMsg); return false; } }