@Override
    public void indicateError(Throwable t) {
      LOG.error("Failed to update guaranteed tasks count for the session " + session, t);
      boolean isOkToFail = session.setFailedToSendGuaranteed();
      if (isOkToFail) return;
      // RPC already handles retries, so we will just try to kill the session here.
      // This will cause the current query to fail. We could instead keep retrying.
      try {
        session.handleUpdateError(endpointVersion);
      } catch (Exception e) {
        LOG.error("Failed to kill the session " + session);
      }
    }
Implements query resource allocation using guaranteed tasks.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/GuaranteedTasksAllocator.java