private Pair<Integer, Integer> getAllValuesFromMmap(ByteBuffer mmap, StoreKey keyToFind, int positiveMatchInd,
        int totalEntries, NavigableSet<IndexValue> values) throws StoreException {
      byte[] buf = new byte[persistedValueSize];
      // add the value at the positive match and anything after that matches
      int end = positiveMatchInd;
      for (; end < totalEntries && getKeyAt(mmap, end).equals(keyToFind); end++) {
        logger.trace("Index Segment {}: found {} at {}", indexFile.getAbsolutePath(), keyToFind, end);
        mmap.get(buf);
        values.add(new IndexValue(startOffset.getName(), ByteBuffer.wrap(buf), getVersion()));
      }
      end--;

      // add any values before the match
      int start = positiveMatchInd - 1;
      for (; start >= 0 && getKeyAt(mmap, start).equals(keyToFind); start--) {
        logger.trace("Index Segment {}: found {} at {}", indexFile.getAbsolutePath(), keyToFind, start);
        mmap.get(buf);
        values.add(new IndexValue(startOffset.getName(), ByteBuffer.wrap(buf), getVersion()));
      }
      return new Pair<>(start, end);
    }
Gets values for all matches for {@code keyToFind} at and in the vicinity of {@code positiveMatchInd}.
@param mmap the serEntries to read values off of
@param keyToFind the needle {@link StoreKey}
@param positiveMatchInd the index of a confirmed positive match
@param totalEntries the total number of entries in the index
@param values the set to which the {@link IndexValue}s will be added
@return a pair consisting of the lowest index that matched the key and the highest
@throws StoreException if there are problems reading from the mmap
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java