private int getRepeatTolerance(AlertDefinitionEntity definition, String clusterName ){

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

    int repeatTolerance = 1;
    try {
      Cluster cluster = clusters.get().getCluster(clusterName);
      String value = cluster.getClusterProperty(ConfigHelper.CLUSTER_ENV_ALERT_REPEAT_TOLERANCE, "1");
      repeatTolerance = NumberUtils.toInt(value, 1);
    } catch (AmbariException ambariException) {
      LOG.warn("Unable to read {}/{} from cluster {}, defaulting to 1", ConfigHelper.CLUSTER_ENV,
          ConfigHelper.CLUSTER_ENV_ALERT_REPEAT_TOLERANCE, clusterName, 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 clusterName
         the name of the cluster (not {@code null}).
@return the repeat tolerance for the alert
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AlertResourceProvider.java