void getIndexEntriesSince(StoreKey key, FindEntriesCondition findEntriesCondition, List<IndexEntry> entries,
        AtomicLong currentTotalSizeOfEntriesInBytes, boolean inclusive) throws StoreException {
      int index = 0;
      NavigableSet<IndexValue> values = new TreeSet<>();
      if (key != null) {
        index = findIndex(key, serEntries.duplicate());
      }
      if (index != -1) {
        ByteBuffer readBuf = serEntries.duplicate();
        int totalEntries = numberOfEntries(readBuf);
        while (findEntriesCondition.proceed(currentTotalSizeOfEntriesInBytes.get(), getLastModifiedTimeSecs())
            && index < totalEntries) {
          StoreKey newKey = getKeyAt(readBuf, index);
          // we include the key in the final list if it is not the initial key or if the initial key was null
          if (key == null || newKey.compareTo(key) != 0 || inclusive) {
            values.clear();
            index = getAllValuesFromMmap(readBuf, newKey, index, totalEntries, values).getSecond();
            for (IndexValue value : values) {
              entries.add(new IndexEntry(newKey, value));
              currentTotalSizeOfEntriesInBytes.addAndGet(value.getSize());
            }
          }
          index++;
        }
      } else {
        logger.error("IndexSegment : {} index not found for key {}", indexFile.getAbsolutePath(), key);
        metrics.keyInFindEntriesAbsent.inc();
      }
    }
Gets all the index entries upto maxEntries from the start of a given key (whether to include this key depends on
inclusive variable) or all entries if key is null, till maxTotalSizeOfEntriesInBytes
@param key The key from where to start retrieving entries.
           If the key is null, all entries are retrieved up to max entries
@param findEntriesCondition The condition that determines when to stop fetching entries.
@param entries The input entries list that needs to be filled. The entries list can have existing entries
@param currentTotalSizeOfEntriesInBytes The current total size in bytes of the entries
@param inclusive whether to include entries associated with given key in returned result.
@throws StoreException
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java