@Override
  public List take(int batchSize) throws CacheException, InterruptedException {
    List batch = new ArrayList(batchSize * 2);
    for (int i = 0; i < batchSize; i++) {
      Object obj = take();
      if (obj != null) {
        batch.add(obj);
      } else {
        break;
      }
    }
    if (logger.isTraceEnabled()) {
      logger.trace("{}: Took a batch of {} entries", this, batch.size());
    }
    return batch;
  }
For non blocking queue , this method either returns null or an Object. For blocking queue it
will always return with an Object or wait for queue to be populated.

@throws CacheException The exception can be thrown by BlockingQueue if it encounters
        InterruptedException while waiting for data
geode-core/src/main/java/org/apache/geode/internal/cache/ha/HARegionQueue.java