private FeedSpecificStore getOrCreateFeedSpecificStore(final long refStreamId) {
        final String feedName = lookUpFeedName(refStreamId);
        Objects.requireNonNull(feedName);

        final RefDataOffHeapStore feedSpecificStore = feedNameToStoreMap.computeIfAbsent(
                feedName,
                this::getOrCreateFeedSpecificStore);

        // We migrate at the refStreamId level, so we just hold a set of IDs rather than a load of
        // RefStreamDefinition objects which will be more costly to check against. In most cases there
        // will only be one RefStreamDefinition per refStreamId
        if (legacyRefDataStore != null
            && migrationCheckRequired
            && !migratedRefStreamIds.contains(refStreamId)) {

            if (feedSpecificStore.exists(refStreamId)) {
                // Already migrated, therefore add it to our set, so we don't need to do the
                // costly exists check again.
                LOGGER.trace("refStreamId: {} already migrated", refStreamId);
                migratedRefStreamIds.add(refStreamId);
            } else {
                try {
                    migrateRefStream(refStreamId, feedSpecificStore);
                } catch (Exception e) {
                    // We can't risk the migration holding up processing, so if it fails just ignore it.
                    // The caller will then get a feed specific store that doesn't contain the stream so will try to
                    // load it as normal.
                    LOGGER.error("Error migrating refStreamId: {} to feed store '{}'. " +
                                 "This stream will not be migrated so will have to be re-loaded as normal. " +
                                 "Migration may be tried again if stroom is re-booted. {}",
                            refStreamId, feedName, e.getMessage(), e);
                } finally {
                    // Even though we haven't migrated it, mark it as such, so we don't try again.
                    migratedRefStreamIds.add(refStreamId);
                }
            }
        } else {
            LOGGER.trace("No migration required");
        }

        return new FeedSpecificStore(feedName, feedSpecificStore);
    }
Get all ref stores keyed by feed name

@return Map of feedName => {@link RefDataOffHeapStore}
stroom-pipeline/src/main/java/stroom/pipeline/refdata/store/offheapstore/DelegatingRefDataOffHeapStore.java