Class PipelineGraphFactory
java.lang.Object
ai.pipestream.module.pipelineprobe.e2e.PipelineGraphFactory
Builds a
PipelineGraph from a RunPipelineCrawlRequest's
source / steps / observe / transport selection. Pure factory — no I/O,
no engine calls, no test orchestration. Easy to unit-test.
Responsibilities:
- Cascade upstream dependencies:
SEMANTIC_GRAPHimpliesEMBEDDER,EMBEDDERimpliesCHUNKER. - Drop
PARSERwhen source isJDBC(JDBC reads structured rows; nothing to parse). - Add a sidecar fan-out tap on every effective step. Taps for steps
in
observe_stepscarry theTestProcessor.OBSERVE_RICH_PARAMflag so the TestProcessor feeds theRichObservationCollectorin addition to the always-onTransportTestCounter. - Always append a testing-sidecar terminal after the last real main-flow step. Per-step taps remain sibling fan-outs for observation.
- Wire main-flow edges.
transport_typeon proto is legacy (engine uses Kafka pointers + claim-check only; TODO stop settingTransportType). - Tap fan-out edges to testing-sidecar for per-step observation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult ofbuild(String, String, PipelineSource, Set, Set, Set, List, int, Struct, Struct, Struct, Struct, Struct, String)— graph + names callers need to dispatch into it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(String graphId, String clusterId, ai.pipestream.testing.harness.v1.PipelineSource source, Set<ai.pipestream.testing.harness.v1.PipelineStep> requestedSteps, Set<ai.pipestream.testing.harness.v1.PipelineStep> observedSteps, Set<ai.pipestream.testing.harness.v1.PipelineStep> persistedSteps, List<ai.pipestream.testing.harness.v1.E2ETransportType> edgeTransports, int kafkaPartitions, com.google.protobuf.Struct parserCustomConfig, com.google.protobuf.Struct chunkerCustomConfig, com.google.protobuf.Struct embedderCustomConfig, com.google.protobuf.Struct semanticCustomConfig, com.google.protobuf.Struct sinkCustomConfig, String datasourceId) Build the graph for a request.voidvalidateShape(ai.pipestream.testing.harness.v1.PipelineSource source, Set<ai.pipestream.testing.harness.v1.PipelineStep> requestedSteps, List<ai.pipestream.testing.harness.v1.E2ETransportType> edgeTransports) Validate the request-derived graph shape without building anything.
-
Constructor Details
-
PipelineGraphFactory
public PipelineGraphFactory()Creates the pipeline-graph factory. The tuning helper collaborator is injected by the container; instances are managed by CDI.
-
-
Method Details
-
validateShape
public void validateShape(ai.pipestream.testing.harness.v1.PipelineSource source, Set<ai.pipestream.testing.harness.v1.PipelineStep> requestedSteps, List<ai.pipestream.testing.harness.v1.E2ETransportType> edgeTransports) Validate the request-derived graph shape without building anything. Runs the same step cascade and edge-transport arity checks asbuild(String, String, PipelineSource, Set, Set, Set, List, int, Struct, Struct, Struct, Struct, Struct, String)and throws the identicalIllegalArgumentExceptions. The orchestration driver calls this BEFORE provisioning accounts and datasources, so a request that can never build a graph never mints resources for its own cleanup to race against.- Parameters:
source- the pipeline source (drives the step cascade)requestedSteps- the requested pipeline stepsedgeTransports- the per-main-flow-edge transport selection to validate- Throws:
IllegalArgumentException- if the edge-transport count does not match the number of main-flow edges the cascade would produce
-
build
public PipelineGraphFactory.Built build(String graphId, String clusterId, ai.pipestream.testing.harness.v1.PipelineSource source, Set<ai.pipestream.testing.harness.v1.PipelineStep> requestedSteps, Set<ai.pipestream.testing.harness.v1.PipelineStep> observedSteps, Set<ai.pipestream.testing.harness.v1.PipelineStep> persistedSteps, List<ai.pipestream.testing.harness.v1.E2ETransportType> edgeTransports, int kafkaPartitions, com.google.protobuf.Struct parserCustomConfig, com.google.protobuf.Struct chunkerCustomConfig, com.google.protobuf.Struct embedderCustomConfig, com.google.protobuf.Struct semanticCustomConfig, com.google.protobuf.Struct sinkCustomConfig, String datasourceId) Build the graph for a request. Configs that need per-step custom_config are passed in by the caller (avoid coupling the factory to test-state).- Parameters:
graphId- the graph id to assignclusterId- the cluster id to assignsource- the pipeline source (drives the step cascade)requestedSteps- the requested pipeline steps (before cascade)observedSteps- steps whose taps run in rich-observation modepersistedSteps- steps whose nodes keep their consumed input claim-check body for replayedgeTransports- per-main-flow-edge transport selection; empty/null fills with Kafka placeholderskafkaPartitions- kafka-partition count applied to main-flow nodesparserCustomConfig- custom config for the parser node, ornullchunkerCustomConfig- custom config for the chunker node, ornullembedderCustomConfig- custom config for the embedder node, ornullsemanticCustomConfig- custom config for the semantic-graph node, ornullsinkCustomConfig- custom config for the opensearch-sink node, ornulldatasourceId- datasource id declared on the virtual intake node- Returns:
- the built graph plus the node-ids callers need to dispatch into and wait on it
- Throws:
IllegalArgumentException- if the edge-transport count does not match the number of main-flow edges, including the tap-only case where it must be empty
-