Class CourtFixtureSource

java.lang.Object
ai.pipestream.module.pipelineprobe.opensearch.CourtFixtureSource

@ApplicationScoped public class CourtFixtureSource extends Object
Streams court-1000 PipeDoc fixtures off the classpath.

Backed by the two test corpora published to Maven Central:

  • ai.pipestream:chunker-pipedocs-court-1000 — 1000 docs after the chunker stage (semantic_results filled, no embedding vectors).
  • ai.pipestream:embedder-pipedocs-court-1000 — same 1000 docs with embedding vectors attached.

Layout inside both jars: fixtures/court-1000/<stage>/doc_<N>.pb where <stage> is chunker or embedder and <N> runs 1..1000. Each file is one PipeDoc encoded as a raw protobuf — NOT length-delimited, NOT gzipped. PipeDoc.parseFrom(InputStream) consumes the whole stream.

Used by IndexPushDriver to feed the OSS StreamDocuments bidi RPC for the OpenSearch indexing test tab. The iterator is single-pass and lazily opens each resource so a 1000-doc run never holds more than one doc's worth of bytes in memory at a time.

  • Constructor Details

    • CourtFixtureSource

      public CourtFixtureSource()
      CDI.
  • Method Details

    • open

      public Iterator<ai.pipestream.data.v1.PipeDoc> open(CourtFixtureSource.Stage stage, int limit)
      Open a single-pass iterator over up to limit PipeDocs from the selected stage. Docs are emitted in numeric order (doc_1.pb, doc_2.pb, …) up to limit or 1000, whichever comes first.

      The iterator opens each .pb resource lazily on Iterator.next() and closes it before returning the parsed PipeDoc; callers do not need to drain or close the iterator.

      Missing doc files (gaps in the numbering — the court-1000 jars have them, e.g. doc_993doc_998 are absent) are skipped silently; the iterator advances to the next present file and keeps going until it has emitted limit docs or scanned the full 1..1000 range.

      Parameters:
      stage - which corpus to read from
      limit - max number of docs to emit; clamped to [1, 1000]
      Returns:
      a single-pass iterator over PipeDocs
    • count

      public int count(CourtFixtureSource.Stage stage, int limit)
      Cheap probe — counts how many doc_<N>.pb resources are actually present on the classpath for the given stage. Scans the full 1..1000 range and counts everything that exists, then caps at limit. Gaps in the numbering are tolerated (court-1000 jars have some) — we don't return early on the first missing index.
      Parameters:
      stage - which corpus to probe
      limit - upper bound on the returned count; clamped to [1, 1000]
      Returns:
      number of resources present, in [0, limit]