public boolean checkStaleConfigsStatusForHostComponent(ServiceComponentHost sch,
                                                         Map<String, Collection<String>> changedConfigs) throws AmbariException {
    HostComponentDesiredStateEntity hostComponentDesiredStateEntity = sch.getDesiredStateEntity();
    if (sch.isRestartRequired(hostComponentDesiredStateEntity)) {
      return true;
    }
    boolean stale = false;

    Cluster cluster = clusters.getClusterById(sch.getClusterId());

    StackId stackId = sch.getServiceComponent().getDesiredStackId();

    StackInfo stackInfo = ambariMetaInfo.getStack(stackId);

    ServiceInfo serviceInfo = ambariMetaInfo.getService(stackId.getStackName(),
        stackId.getStackVersion(), sch.getServiceName());

    ComponentInfo componentInfo = serviceInfo.getComponentByName(sch.getServiceComponentName());

    List<String> changedProperties = new LinkedList<>();
    for (Map.Entry<String, Collection<String>> changedConfigType : changedConfigs.entrySet()) {
      String type = changedConfigType.getKey();
      stale |= (serviceInfo.hasConfigDependency(type) || componentInfo.hasConfigType(type));
      if (stale) {
        for (String propertyName : changedConfigType.getValue()) {
          changedProperties.add(type + "/" + propertyName);
        }
      }
    }

    String refreshCommand = calculateRefreshCommand(stackInfo.getRefreshCommandConfiguration(), sch, changedProperties);

    Map<String, HostConfig> actual = sch.getActualConfigs();

    Map<String, Map<String, String>> desired = getEffectiveDesiredTags(cluster, sch.getHostName(),cluster.getDesiredConfigs());

    if (STALE_CONFIGS_CACHE_ENABLED) {
      if (refreshCommand != null) {
        int staleHash = Objects.hashCode(actual.hashCode(),
            desired.hashCode(),
            sch.getHostName(),
            sch.getServiceComponentName(),
            sch.getServiceName());
        refreshConfigCommandCache.put(staleHash, refreshCommand);
      }
    }

    return stale;
  }
Checks configs are stale for specified host component.
@param sch host component to check.
@param changedConfigs map of config types to collections of changed properties' names.
@return true if configs are stale.
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java