@VisibleForTesting
  protected int getExecutorCount(boolean allowUpdate) {
    if (allowUpdate && !clusterState.initClusterInfo()) {
      LOG.warn("Failed to get LLAP cluster information for "
          + HiveConf.getTrimmedVar(this.conf, ConfVars.LLAP_DAEMON_SERVICE_HOSTS)
          + "; we may rely on outdated cluster status");
    }
    if (!clusterState.hasClusterInfo()) {
      LOG.error("No cluster information available to allocate; no guaranteed tasks will be used");
      return 0;
    }
    int unknownNodes = clusterState.getNodeCountWithUnknownExecutors();
    if (unknownNodes > 0) {
      LOG.error("There are " + unknownNodes + " nodes with unknown executor count; only " +
          clusterState.getKnownExecutorCount() + " guaranteed tasks will be allocated");
    }
    return clusterState.getKnownExecutorCount();
  }
Implements query resource allocation using guaranteed tasks.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/GuaranteedTasksAllocator.java