code: private void addPendingRequest(ResourceRequestInfo req) {
      idToPendingRequests.put(req.getId(), req);
      if (req.getHosts() != null && req.getHosts().size() > 0) {
        Context c = getContext(req.getType());
        for (RequestedNode node: req.getRequestedNodes()) {
          String host = node.getHost();
          List<ResourceRequestInfo> hostReqs = c.hostToPendingRequests.get(host);
          if (hostReqs == null) {
            hostReqs = new LinkedList<ResourceRequestInfo>();
            c.hostToPendingRequests.put(host, hostReqs);
          }
          hostReqs.add(req);
          Node rack = node.getRack();
          List<ResourceRequestInfo> rackReqs = c.rackToPendingRequests.get(rack);
          if (rackReqs == null) {
            rackReqs = new LinkedList<ResourceRequestInfo>();
            c.rackToPendingRequests.put(rack, rackReqs);
          }
          rackReqs.add(req);
        }
      }
      // Always add to the "any" list.
      Context c = getContext(req.getType());
      c.anyHostRequests.add(req);
      addPendingRequestForType(req);
    }
docs: Add a request to the list of pending
  @param req the request to add