public Iterator<IndexEntry> iterator() {
    NavigableMap<StoreKey, ConcurrentSkipListSet<IndexValue>> indexCopy = index;
    rwLock.readLock().lock();
    boolean isSealed = sealed.get();
    rwLock.readLock().unlock();
    if (!isSealed) {
      return new UnsealedIndexSegmentEntryIterator(indexCopy);
    }
    return new SealedIndexSegmentEntryIterator();
  }
Return an {@link Iterator<IndexEntry>} from an IndexSegment that iterates over all the {@link IndexEntry}s in the same
order of {@link StoreKey}. And when the {@link StoreKey}s are the same, it iterates over the entry in the same order
as {@link Offset}.

When the {@link IndexSegment} is unsealed, newly added entries don't effect the iterator. Iterator takes a snapshot
of existing entries while creating this iterator.

This {@link Iterator<IndexEntry>} is a readonly iterator. Invoking {@link Iterator#remove()} would end up throwing
an {@link UnsupportedOperationException}.

The {@link IndexEntry} returned by this iterator is an identical deep clone of the entry in the segment. Changing
the returned entry won't change the entry in the segment.
@return an {@link Iterator<IndexEntry>}.
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java