code: private boolean getEntries(SortedMap<byte[], SimpleQueueEntry> entries, int maxBatchSize) throws IOException {
      boolean hasEntry = fetchFromCache(entries, maxBatchSize);
  
      // If not enough entries from the cache, try to get more.
      // ANDREAS: I think this is wrong. If the batch=10, and the cache has 5 entries, but populateCache cannot
      // fetch more entries, then we have 5 and should return true. But this code will return false.
      // TERENCE: If there are 5 entries in the cache, the first call to fetchFromCache will return true,
      // the second call to fetchFromCache from call to populateCache will return false, but
      // hasEntry = false || true => true, hence returning true.
      if (entries.size() < maxBatchSize) {
        populateRowCache(entries.keySet(), maxBatchSize);
        hasEntry = fetchFromCache(entries, maxBatchSize) || hasEntry;
      }
  
      return hasEntry;
    }
docs: Try to dequeue (claim) entries up to a maximum size.
  @param entries For claimed entries to fill in.
  @param maxBatchSize Maximum number of entries to claim.
  @return The entries instance.
  @throws java.io.IOException