@Transactional
  public void removeAllGroups(long clusterId) {
    List<AlertGroupEntity> groups = findAllGroups(clusterId);
    for (AlertGroupEntity group : groups) {
      remove(group, false);
    }
    AlertGroupsUpdateEvent alertGroupsUpdateEvent = AlertGroupsUpdateEvent.deleteAlertGroupsUpdateEvent(
        groups.stream().map(AlertGroupEntity::getGroupId).collect(Collectors.toList()));
    STOMPUpdatePublisher.publish(alertGroupsUpdateEvent);
  }
Removes all {@link AlertDefinitionEntity} that are associated with the
specified cluster ID.

@param clusterId
         the cluster ID.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertDispatchDAO.java