Class SampleDataRegistry

java.lang.Object
ai.pipestream.module.pipelineprobe.sampledata.SampleDataRegistry

@ApplicationScoped public class SampleDataRegistry extends Object
Discovers every sample-data fixture jar on the classpath by scanning for its META-INF/pipestream-sample-data.json descriptor, and exposes them as a queryable registry — keyed by artifactId and by the step each dataset feeds.

This is the consumer side of the "register each dataset" design: the data jars stay pure (a single passive JSON resource, zero CDI/framework deps); this one bean in the harness does the discovery. Drop a new <step>-input-court dependency on the classpath and it shows up here automatically — no code change.

The registry powers expected-vs-actual count assertions (the descriptor's sourceDocCount is the expected per-step count already surfaced in the crawl panels) and tells the stress/Module-Test features where each step's input docs live.

  • Constructor Details

    • SampleDataRegistry

      public SampleDataRegistry()
      Creates the registry; its ObjectMapper is injected and it is managed by CDI.
  • Method Details

    • all

      public List<SampleDataDescriptor> all()
      All discovered datasets, ordered by step it feeds.
      Returns:
      the discovered descriptors sorted by SampleDataDescriptor.stage()
    • forStage

      public Optional<SampleDataDescriptor> forStage(String stage)
      Dataset that feeds the given step (e.g. "chunker"), if present.
      Parameters:
      stage - the pipeline step the dataset feeds
      Returns:
      the matching descriptor, or empty if no dataset feeds that step
    • forArtifact

      public Optional<SampleDataDescriptor> forArtifact(String artifactId)
      Dataset by Maven artifactId, if present.
      Parameters:
      artifactId - the Maven artifactId to look up
      Returns:
      the matching descriptor, or empty if no such dataset is registered
    • expectedDocCount

      public Optional<Integer> expectedDocCount(String stage)
      Expected doc count for a step's input dataset, or empty if no such dataset.
      Parameters:
      stage - the pipeline step whose input dataset to look up
      Returns:
      the dataset's sourceDocCount, or empty if no dataset feeds that step
    • stages

      public Collection<String> stages()
      The set of steps that have a registered input dataset.
      Returns:
      the stage keys of all discovered datasets