private void updateSessionAsync(final WmTezSession session, final Integer intAlloc) {
    Integer valueToSend = session.setSendingGuaranteed(intAlloc);
    if (valueToSend == null) return;
    // Note: this assumes that the pattern where the same session object is reset with a different
    //       Tez client is not used. It was used a lot in the past but appears to be gone from most
    //       HS2 session pool paths, and this patch removes the last one (reopen).
    UpdateQueryRequestProto request = UpdateQueryRequestProto
        .newBuilder().setGuaranteedTaskCount(valueToSend.intValue()).build();
    LOG.info("Updating {} with {} guaranteed tasks", session.getSessionId(), intAlloc);
    amCommunicator.sendUpdateQuery(request, (AmPluginNode)session, new UpdateCallback(session));
  }
Implements query resource allocation using guaranteed tasks.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/GuaranteedTasksAllocator.java