private void processAcceptedHostOffer(final ClusterTopology topology, final HostOfferResponse response, final HostImpl host) {
    final String hostName = host.getHostName();
    try {
      topology.addHostToTopology(response.getHostGroupName(), hostName);

      // update the host with the rack info if applicable
      updateHostWithRackInfo(topology, response, host);

    } catch (InvalidTopologyException | NoSuchHostGroupException e) {
      // host already registered
      throw new RuntimeException("An internal error occurred while performing request host registration: " + e, e);
    }

    // persist the host request -> hostName association
    try {
      RetryHelper.executeWithRetry(new Callable<Void>() {
        @Override
        public Void call() throws Exception {
          persistTopologyHostRegistration(response.getHostRequestId(), host);
          return null;
        }
      });
    } catch (AmbariException e) {
      LOG.error("Exception ocurred while registering host name", e);
      throw new RuntimeException(e);
    }

    LOG.info("TopologyManager.processAcceptedHostOffer: queue tasks for host = {} which responded {}", hostName, response.getAnswer());
    queueHostTasks(topology, response, hostName);

  }
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