public void updateAmEndpointInfo(TezAmInstance si, int ephSeqVersion) {
    AmPluginInfo info = si == null ? null : new AmPluginInfo(si.getHost(), si.getPluginPort(),
        si.getPluginToken(), si.getPluginTokenJobId());
    synchronized (amPluginInfoLock) {
      // Ignore the outdated updates; for the same version, ignore non-null updates because
      // we assume that removal is the last thing that happens for any given version.
      if ((amPluginEndpointVersion != null) && ((amPluginEndpointVersion > ephSeqVersion)
          || (amPluginEndpointVersion == ephSeqVersion && info != null))) {
        LOG.info("Ignoring an outdated info update {}: {}", ephSeqVersion, si);
        return;
      }
      this.amPluginEndpointVersion = ephSeqVersion;
      this.amPluginInfo = info;
      if (info != null) {
        // Only update someone waiting for info if we have the info.
        if (amRegistryFuture != null) {
          amRegistryFuture.set(this);
          amRegistryFuture = null;
        }
        if (timeoutTimer != null) {
          timeoutTimer.cancel(true);
          timeoutTimer = null;
        }
      }
    }
  }
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