private void drainRequestQueue(List<RequestInfo> requestsToSend) {
    Timer.Context timer = routerMetrics.drainRequestQueueTime.time();
    int outOfQuotaRequests = 0;
    int delayedRequests = 0;
    for (QuotaMethod quotaMethod : QuotaMethod.values()) {
      Map<QuotaResource, LinkedList<RequestInfo>> queue = getRequestQueue(quotaMethod);
      pollQuotaCompliantRequests(requestsToSend, queue);
      outOfQuotaRequests += queue.size();
      pollQuotaExceedAllowedRequestsIfAny(requestsToSend, queue);
      delayedRequests += queue.size();
    }
    outOfQuotaResourcesInQueue = outOfQuotaRequests;
    delayedQuotaResourcesInQueue = delayedRequests;
    timer.stop();
  }
Drain the request queue based on quota and system resources and update the requests to be send to {@code requestsToSend}.
@param requestsToSend a list of {@link RequestInfo} that will contain the requests to be sent out.
ambry-router/src/main/java/com/github/ambry/router/QuotaAwareOperationController.java