public String getRefreshConfigsCommand(Cluster cluster, ServiceComponentHost sch) throws AmbariException {
    String refreshCommand = null;

    Map<String, HostConfig> actual = sch.getActualConfigs();
    if (STALE_CONFIGS_CACHE_ENABLED) {
      Map<String, Map<String, String>> desired = getEffectiveDesiredTags(cluster, sch.getHostName(),
              cluster.getDesiredConfigs());
      int staleHash = Objects.hashCode(actual.hashCode(),
              desired.hashCode(),
              sch.getHostName(),
              sch.getServiceComponentName(),
              sch.getServiceName());
      refreshCommand = refreshConfigCommandCache.getIfPresent(staleHash);
    }
    return refreshCommand;
  }
Calculates config types and keys were changed during configs change.
@param currentServiceConfigEntity service config entity with populated current cluster configs
@param configGroupId id of config group contained changed configs. Can be null in case group is default
@param clusterId cluster id
@param serviceName service name configs were changed for
@return map of type names to collections of properties' names were changed.
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java