private void replayRequests(Map<ClusterTopology, List<LogicalRequest>> persistedRequests) {
    LOG.info("TopologyManager.replayRequests: Entering");
    boolean configChecked = false;
    for (Map.Entry<ClusterTopology, List<LogicalRequest>> requestEntry : persistedRequests.entrySet()) {
      ClusterTopology topology = requestEntry.getKey();
      clusterTopologyMap.put(topology.getClusterId(), topology);
      // update provision request cache
      LogicalRequest provisionRequest = persistedState.getProvisionRequest(topology.getClusterId());
      if(provisionRequest != null) {
        clusterProvisionWithBlueprintCreateRequests.put(topology.getClusterId(), provisionRequest);
        clusterProvisionWithBlueprintCreationFinished.put(topology.getClusterId(),
                isLogicalRequestFinished(clusterProvisionWithBlueprintCreateRequests.get(topology.getClusterId())));
      }

      for (LogicalRequest logicalRequest : requestEntry.getValue()) {
        allRequests.put(logicalRequest.getRequestId(), logicalRequest);
        if (logicalRequest.hasPendingHostRequests()) {
          outstandingRequests.add(logicalRequest);
          for (String reservedHost : logicalRequest.getReservedHosts()) {
            reservedHosts.put(reservedHost, logicalRequest);
          }
          // completed host requests are host requests which have been mapped to a host
          // and the host has ben added to the cluster
          for (HostRequest hostRequest : logicalRequest.getCompletedHostRequests()) {
            try {
              String hostName = hostRequest.getHostName();
              topology.addHostToTopology(hostRequest.getHostgroupName(), hostName);
              hostsToIgnore.add(hostName);
              LOG.info("TopologyManager.replayRequests: host name = {} has been added to cluster and to ignore list.", hostName);
            } catch (InvalidTopologyException e) {
              LOG.warn("Attempted to add host to multiple host groups while replaying requests: " + e, e);
            } catch (NoSuchHostGroupException e) {
              LOG.warn("Failed to add host to topology while replaying requests: " + e, e);
            }
          }
        }
      }

      if (!configChecked) {
        configChecked = true;
        if (!ambariContext.isTopologyResolved(topology.getClusterId())) {
          if (provisionRequest == null) {
            LOG.info("TopologyManager.replayRequests: no config with TOPOLOGY_RESOLVED found, but provision request missing, skipping cluster config request");
          } else if (provisionRequest.isFinished()) {
            LOG.info("TopologyManager.replayRequests: no config with TOPOLOGY_RESOLVED found, but provision request is finished, skipping cluster config request");
          } else {
            LOG.info("TopologyManager.replayRequests: no config with TOPOLOGY_RESOLVED found, adding cluster config request");
            ClusterConfigurationRequest configRequest = new ClusterConfigurationRequest(ambariContext, topology, false, stackAdvisorBlueprintProcessor);
            addClusterConfigRequest(provisionRequest, topology, configRequest);
          }
        } else {
          getOrCreateTopologyTaskExecutor(topology.getClusterId()).start();
        }
      }
    }
    LOG.info("TopologyManager.replayRequests: Exit");
  }
Gets a map of components keyed by host which have operations in the
{@link HostRoleStatus#PENDING} state. This could either be because hosts
have not registered or becuase the operations are actually waiting to be
queued.

@return a mapping of host with pending components.
ambari-server/src/main/java/org/apache/ambari/server/topology/TopologyManager.java