public FsOrphanMetaFinderProgress scan(final Consumer<SimpleMeta> orphanConsumer,
                                           final TaskContext taskContext) {
        final long maxId = metaService.getMaxId();

        final int batchSize = fsVolumeConfigProvider.get().getFindOrphanedMetaBatchSize();
        final FsOrphanMetaFinderProgress progress = new FsOrphanMetaFinderProgress(
                taskContext,
                maxId,
                batchSize);

        long minId = dataVolumeService.getOrphanedMetaTrackerValue();
        LOGGER.info("Starting orphaned meta finder scan with min ID {}, max ID {}, batch size {}",
                minId, maxId, batchSize);
        // Log initial position
        progress.log();

        while (minId != -1
                && !Thread.currentThread().isInterrupted()
                && !taskContext.isTerminated()) {
            minId = scanBatch(minId, maxId, orphanConsumer, progress, taskContext);
        }
        if (Thread.currentThread().isInterrupted() || taskContext.isTerminated()) {
            LOGGER.info("Aborted orphaned meta finder scan at meta ID {}, max ID {}, batch size {}",
                    progress.getId(), maxId, batchSize);
        }

        LOGGER.debug(LogUtil.message("Total file list duration: {}, avg: {}",
                progress.getTotalFileListDuration(),
                progress.getAverageFileListDuration()));

        return progress;
    }
API used by the tasks to interface to the stream store under the bonnet.
stroom-data/stroom-data-store-impl-fs/src/main/java/stroom/data/store/impl/fs/FsOrphanMetaFinder.java