public void stop() throws Exception {
    if ((instance == null) || !this.hasInitialSessions) {
      return;
    }
    List<TezSessionState> sessionsToClose = null;
    synchronized (openSessions) {
      sessionsToClose = new ArrayList<TezSessionState>(openSessions);
    }

    // we can just stop all the sessions
    for (TezSessionState sessionState : sessionsToClose) {
      if (sessionState.isDefault()) {
        sessionState.close(false);
      }
    }

    if (expirationTracker != null) {
      expirationTracker.stop();
    }

    if (triggerValidatorRunnable != null) {
      stopTriggerValidator();
    }

    metrics.stop();
    instance = null;
  }
@param conf HiveConf that is used to initialize the session
@param queueName could be null. Set in the tez session.
@param doOpen
@return
@throws Exception
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionPoolManager.java