public T getUpdateIfChanged(String agentHash, Long hostId) throws AmbariException {
    T hostData = initializeDataIfNeeded(hostId, true);
    return !Objects.equals(agentHash, hostData.getHash()) ? hostData : getEmptyData();
  }
Is used to saving and updating last version of event in host scope
@param <T> event with hash to control version
ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AgentHostDataHolder.java