public synchronized HostOfferResponse offer(Host host) {
    if (!isOutstanding) {
      return HostOfferResponse.DECLINED_DUE_TO_DONE;
    }
    if (matchesHost(host)) {
      isOutstanding = false;
      hostname = host.getHostName();
      setHostOnTasks(host);
      return HostOfferResponse.createAcceptedResponse(id, hostGroup.getName(), topologyTasks);
    } else {
      return HostOfferResponse.DECLINED_DUE_TO_PREDICATE;
    }
  }
Only to be used when replaying persisted requests upon server startup.

@param requestId    logical request id
@param id           host request id
@param predicate    host predicate
@param topology     cluster topology
@param entity       host request entity
ambari-server/src/main/java/org/apache/ambari/server/topology/HostRequest.java