public void registerAggregate(long clusterId, AlertDefinition definition) {
    Long id = Long.valueOf(clusterId);

    if (!m_aggregateMap.containsKey(id)) {
      m_aggregateMap.put(id, new HashMap<>());
    }

    Map<String, AlertDefinition> map = m_aggregateMap.get(id);

    AggregateSource as = (AggregateSource) definition.getSource();

    map.put(as.getAlertName(), definition);
  }
Adds a mapping for a new aggregate definition.

@param clusterId
         the ID of the cluster that the definition is bound to.
@param definition
         the aggregate definition to register (not {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AggregateDefinitionMapping.java