Class OrchestrationDriver

java.lang.Object
ai.pipestream.module.pipelineprobe.pipelinecrawl.OrchestrationDriver

@ApplicationScoped public class OrchestrationDriver extends Object
The actual pipeline-crawl orchestration body (preferred harness path — blocking gRPC, no Mutiny). Single virtual-thread sequence:
  1. Setup: resolve account, build graph from request, ensure active graph version, create connector-admin datasource, bind datasource to graph.
  2. Trigger: call the JDBC connector to register a crawl definition and start it. Returns a triggerId.
  3. Subscribe: open a server-streaming subscription to the connector's StreamCrawlStatus RPC, hydrating a RunLedger from EXPECTED_COUNT_KNOWN, DOC_DISPATCHED, and DISPATCH_COMPLETE events.
  4. Wait: poll the receive-side taps every poll interval, refreshing each StageLedger from TransportTestCounter.getReceivedDocIds(String, String). Emit a tick event per poll and terminate when RunLedger.isClosedSuccessfully() OR a deadline is hit OR the post-dispatch grace window expires without receive-side catch-up.
  5. Summarize: emit a final summary event with the outcome and, if there's a gap, the actual missing doc id set.

Strict error rules: catches list specific exception types only. No catch (RuntimeException), no swallowed exceptions. Any failure before the wait loop is reported via the summary event with the exception type + message; the response stream is closed by the caller's finally on EventEmitter.close().

  • Constructor Details

    • OrchestrationDriver

      public OrchestrationDriver()
      Creates the orchestration driver. Managed by CDI.
  • Method Details

    • run

      public void run(ai.pipestream.testing.harness.v1.RunPipelineCrawlRequest req, EventEmitter emitter)
      Run one orchestration. Caller is on a virtual thread; we block here until the run terminates. Caller is responsible for EventEmitter.close().
      Parameters:
      req - the run request selecting the source and carrying its source config
      emitter - the sink that progress and summary events are emitted to during the run