@Override
    public StoreSizeSummary getTotalSizeOnDisk() {
        final LongAdder totalSizeBytes = new LongAdder();
        final LongAdder storeCount = new LongAdder();

        LOGGER.debug("Getting total size in {}", searchResultStoreDir);

        LOGGER.logDurationIfDebugEnabled(() -> {
            try {
                Files.walkFileTree(searchResultStoreDir, new FileVisitor<>() {
                    @Override
                    public FileVisitResult preVisitDirectory(final Path dir,
                                                             final BasicFileAttributes attrs) {
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult visitFile(final Path file,
                                                     final BasicFileAttributes attrs) {
                        if (Files.isRegularFile(file)) {
                            totalSizeBytes.add(attrs.size());
                            if (LmdbEnvDir.isLmdbDataFile(file)) {
                                storeCount.increment();
                            }
                        }
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult visitFileFailed(final Path file,
                                                           final IOException exc) {
                        return FileVisitResult.CONTINUE;
                    }

                    @Override
                    public FileVisitResult postVisitDirectory(final Path dir,
                                                              final IOException exc) {
                        return FileVisitResult.CONTINUE;
                    }
                });
            } catch (IOException | RuntimeException e) {
                LOGGER.error("Error calculating disk usage for path {}",
                        searchResultStoreDir.normalize(), e);
                // Return -1 to indicate a failure
                totalSizeBytes.reset();
                totalSizeBytes.decrement();
                storeCount.reset();
                storeCount.decrement();
            }
        }, "Getting total size");

        LOGGER.debug("total size is {} in {}", totalSizeBytes, searchResultStoreDir);

        return new StoreSizeSummary(totalSizeBytes.longValue(), storeCount.intValue());
    }
@return The size of all result stores. Assumes no other files are stored in the configured
localDir.
stroom-query/stroom-query-common/src/main/java/stroom/query/common/v2/LmdbDataStoreFactory.java