private Set<String> getPreUpgradeCheckFailedHosts(RequestEntity requestEntity) throws Exception {

    List<HostRoleCommandEntity> hostRoleCommandEntities = hostRoleCommandDAO.findByRequest(requestEntity.getRequestId(), true);

    Set<String> failedHosts = new LinkedHashSet<>();
    for (HostRoleCommandEntity hostRoleCommandEntity : hostRoleCommandEntities) {
      HostRoleStatus status = hostRoleCommandEntity.getStatus();
      if (status.isFailedState()) {
        failedHosts.add(hostRoleCommandEntity.getHostName() + "(" + status + ")");
      }
    }
    return failedHosts;
  }
Get the set of hosts (tasks) that failed the check.
@param requestEntity request info to get the task level info.
@return Set of hosts which failed the check along with type of failed state.
@throws Exception
ambari-server/src/main/java/org/apache/ambari/server/checks/AmbariMetricsHadoopSinkVersionCompatibilityCheck.java