public void loadDirectory(final boolean shutdown, final Path importRootDir) {
        LOGGER.info("Loading sample data for directory: " + FileUtil.getCanonicalPath(importRootDir));

        final Path configDir = importRootDir.resolve("config");
        final Path dataDir = importRootDir.resolve("input");
        final Path generatedDataDir = importRootDir.resolve("generated").resolve("input");

        final Path exampleDataDir = importRootDir.resolve("example_data");

//        createStreamAttributes();

        if (Files.exists(configDir)) {
            LOGGER.info("Loading config from {}", configDir.toAbsolutePath().normalize());
            importExportSerializer.read(configDir, null, ImportSettings.auto());

//            // Enable all flags for all feeds.
//            final List<FeedDoc> feeds = feedService.find(new FindFeedCriteria());
//            for (final FeedDoc feed : feeds) {
//                feed.setStatus(FeedStatus.RECEIVE);
//                feedService.save(feed);
//            }

//            LOGGER.info("Volume count = " + commonTestControl.countEntity(VolumeEntity.TABLE_NAME));
            LOGGER.info("Feed count = " + feedStore.list().size());
//            LOGGER.info("StreamAttributeKey count = " + commonTestControl.countEntity(StreamAttributeKey.class));
            LOGGER.info("Dashboard count = " + dashboardStore.list().size());
            LOGGER.info("Pipeline count = " + pipelineStore.list().size());
            LOGGER.info("Index count = " + indexStore.list().size());
            LOGGER.info("StatisticDataSource count = " + statisticStoreStore.list().size());

        } else {
            LOGGER.info("Directory {} doesn't exist so skipping", configDir.toAbsolutePath().normalize());
        }

        LOGGER.info("Checking data dir {}", dataDir.toAbsolutePath().normalize());
        if (Files.exists(dataDir)) {
            // Load data.
            final DataLoader dataLoader = new DataLoader(feedProperties, streamTargetStreamHandlers);

            // We spread the received time over 10 min intervals to help test
            // repo
            // layout start 2 weeks ago.
            final long dayMs = 1000 * 60 * 60 * 24;
            final long tenMinMs = 1000 * 60 * 10;

            // Load each data item 10 times to create a reasonable amount to
            // test.
            final String feedName = "DATA_SPLITTER-EVENTS";
            final CompletableFuture[] futures = new CompletableFuture[LOAD_CYCLES];
            for (int i = 0; i < LOAD_CYCLES; i++) {
                final int finalI = i;
                futures[i] = CompletableFuture.runAsync(() -> {
                    LOGGER.info("Loading data from {}, iteration {}",
                            dataDir.toAbsolutePath().normalize(), finalI);
                    long startTime = System.currentTimeMillis() - (14 * dayMs);

                    // Load reference data first.
                    // Force the effective data to be before the event time in the data that is 2010.....
                    dataLoader.read(dataDir, true,
                            DateUtil.parseNormalDateTimeString("2000-01-01T00:00:00.000Z"));

                    // Then load event data.
                    dataLoader.read(dataDir, false, startTime);
                    startTime += tenMinMs;

                    // Load some randomly generated data.
                    final String randomData = createRandomData();
                    dataLoader.loadInputStream(
                            feedName,
                            "Gen data",
                            null,
                            StreamUtil.stringToStream(randomData),
                            false,
                            startTime);
                    startTime += tenMinMs;
                });
            }
            CompletableFuture.allOf(futures).join();
        } else {
            LOGGER.info("Directory {} doesn't exist so skipping", dataDir.toAbsolutePath().normalize());
        }

        // Load the example data that we don't want to duplicate as is done above
        List.of(exampleDataDir, generatedDataDir)
                .forEach(dir -> {
                    if (Files.exists(dir)) {
                        LOGGER.info("Loading data from {}", dir.toAbsolutePath().normalize());
                        // Load data.
                        final DataLoader dataLoader = new DataLoader(feedProperties, streamTargetStreamHandlers);
                        long startTime = System.currentTimeMillis();

                        // Then load event data.
                        dataLoader.read(dir, false, startTime);
                    } else {
                        LOGGER.info("Directory {} doesn't exist so skipping",
                                dir.toAbsolutePath().normalize());
                    }
                });

        // processorTaskManager.doCreateTasks();

        // // Add an index.
        // final Index index = addIndex();
        // addUserSearch(index);
        // addDictionarySearch(index);
    }
Script to create some base data for testing.
stroom-app/src/test/java/stroom/test/SetupSampleDataBean.java