int size() {
    rwLock.readLock().lock();
    try {
      if (sealed.get()) {
        return sealedIndex.getNumberOfEntries();
      } else {
        return numberOfItems.get();
      }
    } finally {
      rwLock.readLock().unlock();
    }
  }
@return number of IndexEntry items in this segment.
ambry-store/src/main/java/com/github/ambry/store/IndexSegment.java