@Transactional
  int cleanAlertHistoriesForClusterBeforeDate(Long clusterId, long beforeDateMillis) {
    return executeQuery("AlertHistoryEntity.removeInClusterBeforeDate", AlertHistoryEntity.class, clusterId, beforeDateMillis);
  }
Deletes AlertHistory entries in a cluster older than the given date.

@param clusterId        the identifier of the cluster the AlertHistory entries belong to
@param beforeDateMillis the date in milliseconds the
@return a long representing the number of affected (deleted) records
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java