public boolean wasStaleConfigsStatusUpdated(Long clusterId, Long hostId, String serviceName, String hostComponentName, Boolean staleConfigs) {
    if (!stateCache.containsKey(clusterId)) {
      stateCache.put(clusterId, new HashMap<>());
    }
    Map<Long, Map<String, Map<String, Boolean>>> hosts = stateCache.get(clusterId);
    if (!hosts.containsKey(hostId)) {
      hosts.put(hostId, new HashMap<>());
    }
    Map<String, Map<String, Boolean>> services = hosts.get(hostId);
    if (!services.containsKey(serviceName)) {
      services.put(serviceName, new HashMap<>());
    }
    Map<String, Boolean> hostComponents = services.get(serviceName);
    if (staleConfigs.equals(hostComponents.get(hostComponentName))) {
      return false;
    } else {
      hostComponents.put(hostComponentName, staleConfigs);
      return true;
    }
  }
Tries to change cached stale config with new value.
@param clusterId cluster id.
@param hostId host id.
@param serviceName service name.
@param hostComponentName component name.
@param staleConfigs value to check.
@return true if value from cache is different from {@param staleConfigs}.
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java