@Override
  public void removeExecution(ExecutionContext context, int exeId) throws ExecutorException {
    SamzaSqlApplicationRunner runner = executions.get(exeId);
    if (runner != null) {
      if (runner.status().getStatusCode().equals(ApplicationStatus.StatusCode.Running)) {
        throw new ExecutorException("Trying to remove an ongoing execution " + exeId);
      }
      executions.remove(exeId);
    } else {
      throw new ExecutorException("Trying to remove a non-existing SQL execution " + exeId);
    }
  }
Samza implementation of Executor for Samza SQL Shell.
samza-sql-shell/src/main/java/org/apache/samza/sql/client/impl/SamzaExecutor.java