Example #1
0
  @Override
  public void start() {
    LOG.info("QueryMaster start");

    queryHeartbeatThread = new QueryHeartbeatThread();
    queryHeartbeatThread.start();

    clientSessionTimeoutCheckThread = new ClientSessionTimeoutCheckThread();
    clientSessionTimeoutCheckThread.start();

    finishedQueryMasterTaskCleanThread = new FinishedQueryMasterTaskCleanThread();
    finishedQueryMasterTaskCleanThread.start();

    super.start();
  }
Example #2
0
  @Override
  public void stop() {
    if (queryMasterStop.getAndSet(true)) {
      return;
    }

    if (queryHeartbeatThread != null) {
      queryHeartbeatThread.interrupt();
    }

    if (clientSessionTimeoutCheckThread != null) {
      clientSessionTimeoutCheckThread.interrupt();
    }

    if (finishedQueryMasterTaskCleanThread != null) {
      finishedQueryMasterTaskCleanThread.interrupt();
    }
    super.stop();

    LOG.info("QueryMaster stop");
    if (queryMasterContext.getWorkerContext().isYarnContainerMode()) {
      queryMasterContext.getWorkerContext().stopWorker(true);
    }
  }