code: public void stopWorkers() throws Exception {
      if (mWorkers == null) {
        return;
      }
      for (WorkerProcess worker : mWorkers) {
        worker.stop();
      }
      for (Thread thread : mWorkerThreads) {
        while (thread.isAlive()) {
          LOG.info("Stopping thread {}.", thread.getName());
          thread.interrupt();
          thread.join(1000);
        }
      }
      mWorkerThreads.clear();
    }
docs: Stops the workers.