@RequiresSession
  public List<String> getHostsWithPendingTasks(long iLowestRequestIdInProgress,
      long iHighestRequestIdInProgress) {
    TypedQuery<String> query = entityManagerProvider.get().createNamedQuery(
        "HostRoleCommandEntity.findHostsByCommandStatus", String.class);

    query.setParameter("iLowestRequestIdInProgress", iLowestRequestIdInProgress);
    query.setParameter("iHighestRequestIdInProgress", iHighestRequestIdInProgress);
    query.setParameter("statuses", HostRoleStatus.IN_PROGRESS_STATUSES);
    return daoUtils.selectList(query);
  }
Gets a lists of hosts with commands in progress given a range of requests.
The range of requests should include all requests with at least 1 stage in
progress.

@return the list of hosts with commands in progress.
@see HostRoleStatus#IN_PROGRESS_STATUSES
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java