private List<RequestInfo> pollRemoteReplicaGroups(List<RemoteReplicaGroup> remoteReplicaGroups,
      Map<Integer, RequestInfo> correlationIdToRequestInfo,
      Map<Integer, RemoteReplicaGroup> correlationIdToRemoteReplicaGroup) {
    logger.trace("Thread Name: {} Polling {} RemoteReplicaGroups for requests", threadName, remoteReplicaGroups.size());
    List<RequestInfo> requestInfos = new ArrayList<>();
    for (RemoteReplicaGroup group : remoteReplicaGroups) {
      if (group.isDone()) {
        logger.trace("Remote Node: {} Thread Name: {} RemoteReplicaGroup {} is Done", group.getRemoteDataNode(),
            threadName, group.getId());
        continue;
      }
      RequestInfo requestInfo = group.poll();
      if (requestInfo != null) {
        requestInfos.add(requestInfo);
        correlationIdToRemoteReplicaGroup.put(requestInfo.getRequest().getCorrelationId(), group);
        correlationIdToRequestInfo.put(requestInfo.getRequest().getCorrelationId(), requestInfo);
      }
    }
    logger.trace("Thread Name: {} There are {} requests polled from RemoteReplicaGroups", threadName,
        requestInfos.size());
    return requestInfos;
  }
Polling the request from each {@link RemoteReplicaGroup}. Adding new requests to the {@code correlationIdToRequestInfo}
map and the {@code correlationIdToRemoteReplicaGroup} map.
@param remoteReplicaGroups The list of the {@link RemoteReplicaGroup} to poll requests from.
@param correlationIdToRequestInfo The map from correlation id to request info, new request would be added to this map.
@param correlationIdToRemoteReplicaGroup The map from correlation id to remote replica group, new request would be
                                         added to this map.
@return A list of {@link RequestInfo}s.
ambry-replication/src/main/java/com/github/ambry/replication/ReplicaThread.java