IndexValue getIndexValueOfLastPut() throws StoreException {
    IndexValue indexValueOfLastPut = null;
    NavigableMap<StoreKey, ConcurrentSkipListSet<IndexValue>> indexCopy = index;
    rwLock.readLock().lock();
    boolean isSealed = sealed.get();
    rwLock.readLock().unlock();
    if (isSealed) {
      indexValueOfLastPut = sealedIndex.getIndexValueOfLastPut();
    } else {
      for (Map.Entry<StoreKey, ConcurrentSkipListSet<IndexValue>> entry : indexCopy.entrySet()) {
        for (IndexValue indexValue : entry.getValue()) {
          // FLAGS_DEFAULT_VALUE means PUT record
          if (indexValue.getFlags() == IndexValue.FLAGS_DEFAULT_VALUE && (indexValueOfLastPut == null
              || indexValue.compareTo(indexValueOfLastPut) > 0)) {
            indexValueOfLastPut = indexValue;
            break;
          }
        }
      }
    }
    return indexValueOfLastPut;
  }
@return index value of last PUT record in this index segment. Return {@code null} if no PUT is found
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java