public boolean isConfigStale(String clusterName, String hostname, long recoveryTimestamp) {
    // Look up the last updated timestamp for the clusterName-->hostname-->timestamp if
    // it is available. If found, compare it with the timestamp from the agent. It the timestamp
    // is different from the timestamp sent by the agent, the recovery config on the agent
    // side is stale and should be sent to the agent during this heartbeat.

    if (StringUtils.isEmpty(clusterName)) {
      throw new IllegalArgumentException("clusterName cannot be empty or null.");
    }

    if (StringUtils.isEmpty(hostname)) {
      throw new IllegalArgumentException("hostname cannot be empty or null.");
    }

    ConcurrentHashMap<String, Long> hostTimestamp = timestampMap.get(clusterName);
    if (hostTimestamp == null) {
      return true;
    }

    Long timestamp = hostTimestamp.get(hostname);

    /*
     * An agent that did not get the configuration during registration because it
     * was not yet a part of a cluster but now is will not have an entry.
     */
    if (timestamp == null) {
      return true;
    }

    if (timestamp.longValue() != recoveryTimestamp) {
      return true;
    }

    return false;
  }
Computes if the recovery configuration was updated since the last time it was sent to the agent.

@param clusterName - Name of the cluster which the host belongs to.
@param hostname - Host name from agent.
@param recoveryTimestamp - Time when the recovery configuration was last sent to the agent. Agent
                         stores this value and sends it during each heartbeat. -1 if agent was
                         restarted or configuration was not sent to the agent since it started.
@return
ambari-server/src/main/java/org/apache/ambari/server/agent/RecoveryConfigHelper.java