private int getRepeatTolerance(AlertDefinitionEntity definition, Long clusterId) {

    // if the definition overrides the global value, then use that
    if (definition.isRepeatToleranceEnabled()) {
      return definition.getRepeatTolerance();
    }

    int repeatTolerance = 1;
    try {
      Cluster cluster = m_clusters.get().getCluster(clusterId);
      String value = cluster.getClusterProperty(ConfigHelper.CLUSTER_ENV_ALERT_REPEAT_TOLERANCE, "1");
      repeatTolerance = NumberUtils.toInt(value, 1);
    } catch (AmbariException ambariException) {
      String msg = String.format("Unable to read %s/%s from cluster %s, defaulting to 1",
        ConfigHelper.CLUSTER_ENV, ConfigHelper.CLUSTER_ENV_ALERT_REPEAT_TOLERANCE, clusterId
      );
      LOG.warn(msg, ambariException);
    }

    return repeatTolerance;
  }
Gets the repeat tolerance value for the specified definition. This method
will return the override from the definition if
{@link AlertDefinitionEntity#isRepeatToleranceEnabled()} is {@code true}.
Otherwise, it uses {@link ConfigHelper#CLUSTER_ENV_ALERT_REPEAT_TOLERANCE},
defaulting to {@code 1} if not found.

@param definition the definition (not {@code null}).
@param clusterId the ID of the cluster (not {@code null}).
@return the repeat tolerance for the alert
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/alerts/AlertReceivedListener.java