Class IntakeDocStream
java.lang.Object
ai.pipestream.module.pipelineprobe.moduletest.engineperf.IntakeDocStream
- All Implemented Interfaces:
AutoCloseable
One open bidi stream to connector-intake's
uploadPipeDocStream —
the SAME protocol the JDBC connector speaks (IntakeCrawlStream is
the reference implementation): StreamContext handshake first
(datasource + api key + crawl_id), then one PipeDocItem per doc
with per-doc acks; backpressure is HTTP/2 native.
This is the "sidecar as its own connector" transport for the engine-path perf test: documents enter through the REAL front door and the engine does everything it does in production (claim-check staging, fan-out to the subscribed graph, work dispensing to the module's own worker loop).
Not thread-safe on the upload side — one session, one publisher thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPer-doc intake outcome. -
Constructor Summary
ConstructorsConstructorDescriptionIntakeDocStream(ai.pipestream.connector.intake.v1.ConnectorIntakeServiceGrpc.ConnectorIntakeServiceStub stub, String datasourceId, String apiKey, String crawlId, Duration contextAckTimeout, Duration closeTimeout) Opens the stream, sends the context handshake, and blocks (up tocontextAckTimeout) for the server's accept before returning. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Half-close and wait (bounded) for the server's terminal completion.Push one doc.
-
Constructor Details
-
IntakeDocStream
public IntakeDocStream(ai.pipestream.connector.intake.v1.ConnectorIntakeServiceGrpc.ConnectorIntakeServiceStub stub, String datasourceId, String apiKey, String crawlId, Duration contextAckTimeout, Duration closeTimeout) Opens the stream, sends the context handshake, and blocks (up tocontextAckTimeout) for the server's accept before returning.- Parameters:
stub- the connector-intake async stub to open the upload stream ondatasourceId- the datasource the stream uploads under (sent in the handshake)apiKey- the api key authenticating the call viax-api-keymetadata (never carried inside the StreamContext body)crawlId- the crawl id sent in the context handshakecontextAckTimeout- how long to wait for the server to accept the handshakecloseTimeout- how longclose()waits for terminal completion- Throws:
IllegalStateException- if the context wait is interrupted, times out, or the server rejects the handshake
-
-
Method Details
-
upload
public CompletableFuture<IntakeDocStream.DocAck> upload(ai.pipestream.data.v1.PipeDoc doc, String sourceDocId) Push one doc. Parks the caller only when HTTP/2 flow control says the wire is full (intake backpressure — the production behavior).- Parameters:
doc- the document to uploadsourceDocId- the source doc id correlating this upload to its ack- Returns:
- a future completing with the per-doc
IntakeDocStream.DocAck; already completed with a failed, retryable ack if the stream is closed
-
close
public void close()Half-close and wait (bounded) for the server's terminal completion.- Specified by:
closein interfaceAutoCloseable
-