public boolean isOpen() {
    if (session != null) {
      return true;
    }
    if (sessionFuture == null) {
      return false;
    }
    try {
      TezClient session = sessionFuture.get(0, TimeUnit.NANOSECONDS);
      if (session == null) {
        return false;
      }
      this.session = session;
    } catch (InterruptedException e) {
      Thread.currentThread().interrupt();
      return false;
    } catch (ExecutionException e) {
      throw new RuntimeException(e);
    } catch (TimeoutException | CancellationException e) {
      return false;
    }
    return true;
  }
Constructor. We do not automatically connect, because we only want to
load tez classes when the user has tez installed.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java