public List<Long> getHostIdsByDefinitionId(Long definitionId) {
    return staleAlerts.entrySet().stream()
        .filter(e -> e.getValue().containsKey(definitionId))
        .map(e -> e.getKey()).collect(Collectors.toList());
  }
Retrieves all host ids containing specified definition id.
@param definitionId alert definition id.
@return host ids list.
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertHelper.java