private Set<String> invalidateHosts(long clusterId,
      SourceType definitionSourceType, String definitionName,
      String definitionServiceName, String definitionComponentName) {

    Cluster cluster = null;
    String clusterName = null;
    try {
      cluster = m_clusters.get().getClusterById(clusterId);
      if (null != cluster) {
        clusterName = cluster.getClusterName();
      }

      if (null == cluster) {
        LOG.warn("Unable to lookup cluster with ID {}", clusterId);
      }
    } catch (Exception exception) {
      LOG.error("Unable to lookup cluster with ID {}", clusterId, exception);
    }

    if (null == cluster) {
      return Collections.emptySet();
    }

    // determine which hosts in the cluster would be affected by a change
    // to the specified definition; pass in the definition source type
    // to check for AGGREGATE
    Set<String> affectedHosts = getAssociatedHosts(cluster,
        definitionSourceType, definitionName,
        definitionServiceName, definitionComponentName);

    // invalidate all returned hosts
    for (String hostName : affectedHosts) {
      invalidate(clusterName, hostName);
    }

    return affectedHosts;
  }
Invalidate the hashes of any host that would be affected by the specified
definition. If the definition is an {@link SourceType#AGGREGATE}, this will
return an empty set since aggregates do not affect hosts.

@param clusterId
         the cluster ID
@param definitionSourceType
         the type of alert definition
@param definitionName
         the definition unique name.
@param definitionServiceName
         the definition's service name.
@param definitionComponentName
         the definition's component name.
@return the hosts that were invalidated, or an empty set (never
        {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertDefinitionHash.java