/** * Shuts down the mini cluster dispatcher. If a job is currently running, that job will be * terminally failed. */ public void shutdown() { synchronized (lock) { if (!shutdown) { shutdown = true; LOG.info("Shutting down the job dispatcher"); // in this shutdown code we copy the references to the stack first, // to avoid concurrent modification JobManagerRunner[] runners = this.runners; if (runners != null) { this.runners = null; for (JobManagerRunner runner : runners) { runner.shutdown(); } } } } }
try { if (runners[i] != null) { runners[i].shutdown();