private void loadReferenceData(final TaskContext taskContext,
                                   final RefStreamDefinition refStreamDefinition) {
        // Open the stream source.
        try (final Source source = streamStore.openSource(refStreamDefinition.getStreamId())) {
            if (source != null) {
                final Meta meta = source.getMeta();

                // Load the feed.
                final String feedName = meta.getFeedName();
                feedHolder.setFeedName(feedName);

                // Setup the meta data holder.
                metaDataHolder.setMetaDataProvider(new StreamMetaDataProvider(metaHolder, pipelineStore));

                // Set the pipeline so it can be used by a filter if needed.
                if (refStreamDefinition.getPipelineDocRef() == null ||
                    refStreamDefinition.getPipelineDocRef().getUuid() == null) {
                    throw new RuntimeException("Null reference pipeline");
                }
                final PipelineDoc pipelineDoc = pipelineStore
                        .readDocument(refStreamDefinition.getPipelineDocRef());
                if (pipelineDoc == null) {
                    throw new RuntimeException("Unable to find pipeline with UUID: " +
                                               refStreamDefinition.getPipelineDocRef().getUuid());
                }
                pipelineHolder.setPipeline(refStreamDefinition.getPipelineDocRef());

                // Create the parser.
                final PipelineData pipelineData = pipelineDataCache.get(pipelineDoc);
                final Pipeline pipeline = pipelineFactory.create(pipelineData, taskContext);

                populateMaps(
                        pipeline,
                        meta,
                        source,
                        feedName,
                        refStreamDefinition);

                LOGGER.debug("Finished loading reference data: {}", refStreamDefinition);
                taskContext.info(() -> "Finished " + refStreamDefinition);
            }
        } catch (final UncheckedInterruptedException | TaskTerminatedException e) {
            throw ProcessException.wrap(new TaskTerminatedException());
        } catch (final Exception e) {
            log(Severity.ERROR, e.getMessage(), e);
        }
    }
Loads reference data that meets the supplied criteria into the current
reference data key, value maps.
stroom-pipeline/src/main/java/stroom/pipeline/refdata/ReferenceDataLoadTaskHandler.java