class LogicalRequest extends Request {

  public Set<HostRequest> removeHostRequestByHostName(String hostName) {
    Set<HostRequest> removed = new HashSet<>();
    synchronized (requestsWithReservedHosts) {
      synchronized (outstandingHostRequests) {
        requestsWithReservedHosts.remove(hostName);

        Iterator<HostRequest> hostRequestIterator = outstandingHostRequests.iterator();
        while (hostRequestIterator.hasNext()) {
          HostRequest hostRequest = hostRequestIterator.next();
          if (Objects.equals(hostRequest.getHostName(), hostName)) {
            hostRequestIterator.remove();
            removed.add(hostRequest);
            break;
          }
        }

        //todo: synchronization
        Iterator<HostRequest> allHostRequestIterator = allHostRequests.iterator();
        while (allHostRequestIterator.hasNext()) {
          HostRequest hostRequest = allHostRequestIterator.next();
          if (Objects.equals(hostRequest.getHostName(), hostName)) {
            allHostRequestIterator.remove();
            removed.add(hostRequest);
            break;
          }
        }
      }
    }

    return removed;
  }

  public  LogicalRequest(Long id, TopologyRequest request, ClusterTopology topology);
  public  LogicalRequest(Long id, TopologyRequest request, ClusterTopology topology,
                        TopologyLogicalRequestEntity requestEntity);

}