Integer setSendingGuaranteed(Integer intAlloc) {
    assert intAlloc == null || intAlloc >= 0;
    synchronized (actualState) {
      if (intAlloc != null) {
        actualState.target = intAlloc;
      } else {
        intAlloc = actualState.target;
      }
      if (actualState.sending != -1) return null; // The sender will take care of this.
      if (actualState.sent == intAlloc) return null; // The value didn't change.
      actualState.sending = intAlloc;
      return intAlloc;
    }
  }
The actual state of the guaranteed task, and the update state, for the session.
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/WmTezSession.java