Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java (revision 1814560) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/AbstractFileStore.java (working copy) @@ -29,6 +29,7 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.ExecutionException; +import java.util.concurrent.atomic.AtomicInteger; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; @@ -129,11 +130,14 @@ protected final IOMonitor ioMonitor; + static final AtomicInteger segmentIdAllocations = new AtomicInteger(); + AbstractFileStore(final FileStoreBuilder builder) { this.directory = builder.getDirectory(); this.tracker = new SegmentTracker(new SegmentIdFactory() { @Override @Nonnull public SegmentId newSegmentId(long msb, long lsb) { + segmentIdAllocations.incrementAndGet(); return new SegmentId(AbstractFileStore.this, msb, lsb, segmentCache::recordHit); } }); Index: oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java =================================================================== --- oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (revision 1814560) +++ oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/file/FileStore.java (working copy) @@ -59,6 +59,7 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Consumer; @@ -164,6 +165,8 @@ @Nonnull private final SegmentNotFoundExceptionListener snfeListener; + private static final AtomicInteger uncachedSegmentReads = new AtomicInteger(); + FileStore(final FileStoreBuilder builder) throws InvalidFileStoreVersionException, IOException { super(builder); @@ -477,6 +480,8 @@ fileReaper.reap(); log.info("TarMK closed: {}", directory); + log.info("TarMK segment ID allocations: {}", segmentIdAllocations); + log.info("TarMK uncached segment reads: {}", uncachedSegmentReads); } @Override @@ -490,7 +495,10 @@ @Nonnull public Segment readSegment(final SegmentId id) { try (ShutDownCloser ignored = shutDown.keepAlive()) { - return segmentCache.getSegment(id, () -> readSegmentUncached(tarFiles, id)); + return segmentCache.getSegment(id, () -> { + uncachedSegmentReads.incrementAndGet(); + return readSegmentUncached(tarFiles, id); + }); } catch (ExecutionException e) { SegmentNotFoundException snfe = asSegmentNotFoundException(e, id); snfeListener.notify(id, snfe);