private void createHostRequests(TopologyRequest request, ClusterTopology topology) {
    Map<String, HostGroupInfo> hostGroupInfoMap = request.getHostGroupInfo();
    Blueprint blueprint = topology.getBlueprint();
    boolean skipFailure = topology.getBlueprint().shouldSkipFailure();
    for (HostGroupInfo hostGroupInfo : hostGroupInfoMap.values()) {
      String groupName = hostGroupInfo.getHostGroupName();
      int hostCardinality = hostGroupInfo.getRequestedHostCount();
      List<String> hostnames = new ArrayList<>(hostGroupInfo.getHostNames());

      for (int i = 0; i < hostCardinality; ++i) {
        if (! hostnames.isEmpty()) {
          // host names are specified
          String hostname = hostnames.get(i);
          HostRequest hostRequest = new HostRequest(getRequestId(), hostIdCounter.getAndIncrement(), getClusterId(),
              hostname, blueprint.getName(), blueprint.getHostGroup(groupName), null, topology, skipFailure);
          synchronized (requestsWithReservedHosts) {
            requestsWithReservedHosts.put(hostname, hostRequest);
          }
        } else {
          // host count is specified
          HostRequest hostRequest = new HostRequest(getRequestId(), hostIdCounter.getAndIncrement(), getClusterId(),
              null, blueprint.getName(), blueprint.getHostGroup(groupName), hostGroupInfo.getPredicate(), topology, skipFailure);
          outstandingHostRequests.add(hostRequest);
        }
      }
    }
    allHostRequests.addAll(outstandingHostRequests);
    allHostRequests.addAll(requestsWithReservedHosts.values());

    LOG.info("LogicalRequest.createHostRequests: all host requests size {} , outstanding requests size = {}",
      allHostRequests.size(), outstandingHostRequests.size());
  }
Returns if all the tasks in the logical request have completed state.
ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java