@RequiresSession
  public List<AlertHistoryEntity> findAll(long clusterId) {
    TypedQuery<AlertHistoryEntity> query = m_entityManagerProvider.get().createNamedQuery(
        "AlertHistoryEntity.findAllInCluster", AlertHistoryEntity.class);

    query.setParameter("clusterId", clusterId);

    return m_daoUtils.selectList(query);
  }
Gets all alerts stored in the database for the given cluster.

@param clusterId
         the ID of the cluster.
@return all alerts in the specified cluster or an empty list if none exist
        (never {@code null}).
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/AlertsDAO.java