Class ConnectorIntakeServiceImpl
- All Implemented Interfaces:
io.grpc.BindableService
Handles document streaming, crawl session management, and heartbeat monitoring.
Proto: grpc/grpc-stubs/src/main/proto/module/connectors/connector_intake_service.proto
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<ai.pipestream.connector.intake.EndCrawlSessionResponse> endCrawlSession(ai.pipestream.connector.intake.EndCrawlSessionRequest request) End a crawl session and persist final statistics.io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.HeartbeatResponse> heartbeat(ai.pipestream.connector.intake.HeartbeatRequest request) Heartbeat endpoint for long-running crawls.io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.StartCrawlSessionResponse> startCrawlSession(ai.pipestream.connector.intake.StartCrawlSessionRequest request) Start a new crawl session using the unary RPC endpoint.io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.DocumentIntakeResponse> streamDocuments(io.smallrye.mutiny.Multi<ai.pipestream.connector.intake.DocumentIntakeRequest> requests) Stream processing entry point for the Connector Intake gRPC service.Methods inherited from class ai.pipestream.connector.intake.MutinyConnectorIntakeServiceGrpc.ConnectorIntakeServiceImplBase
bindService, withCompression
-
Constructor Details
-
ConnectorIntakeServiceImpl
public ConnectorIntakeServiceImpl()
-
-
Method Details
-
streamDocuments
public io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.DocumentIntakeResponse> streamDocuments(io.smallrye.mutiny.Multi<ai.pipestream.connector.intake.DocumentIntakeRequest> requests) Stream processing entry point for the Connector Intake gRPC service.CLIENT-SIDE STREAMING: Client sends all chunks, server returns ONE final response.
Consumes a stream of
DocumentIntakeRequestmessages and returns a singleDocumentIntakeResponseafter all chunks are processed. Requests can be one of:SessionStart– must be sent first to authenticate and initialize session.Document– document payload and metadata; may be raw or chunked.
- All incoming requests are collected and processed in parallel.
- Returns ONE final response with batch results after stream completes.
- No intermediate responses - client can fire all chunks without waiting.
- On
SessionStart: validates the connector and creates a persisted crawl session. - On
Document: writes content to the repository-service in parallel.
- Overrides:
streamDocumentsin classai.pipestream.connector.intake.MutinyConnectorIntakeServiceGrpc.ConnectorIntakeServiceImplBase- Parameters:
requests- stream of intake requests for a logical crawl session- Returns:
- single final response with batch processing results
-
startCrawlSession
public io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.StartCrawlSessionResponse> startCrawlSession(ai.pipestream.connector.intake.StartCrawlSessionRequest request) Start a new crawl session using the unary RPC endpoint.Validates the connector credentials and creates a persisted crawl session with optional tracking and orphan-deletion behavior as requested by the client. Metadata is serialized and stored with the session for downstream processing. Reactive semantics:
- Returns a
Unithat completes on the default worker pool due to persistence work. - Failure is mapped to a response with
success=falseand an explanatory message.
- Overrides:
startCrawlSessionin classai.pipestream.connector.intake.MutinyConnectorIntakeServiceGrpc.ConnectorIntakeServiceImplBase- Parameters:
request- request containing connector ID, API key, crawl metadata and options- Returns:
- a
UniemittingStartCrawlSessionResponsewith the created session ID on success
- Returns a
-
endCrawlSession
public io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.EndCrawlSessionResponse> endCrawlSession(ai.pipestream.connector.intake.EndCrawlSessionRequest request) End a crawl session and persist final statistics.Looks up the session, applies summary statistics if provided, and transitions the session to a completed state. If the session does not exist, a response with
success=falseis returned. Reactive semantics:- Runs on the default worker pool due to database access.
- Errors are mapped to a
success=falseresponse.
- Overrides:
endCrawlSessionin classai.pipestream.connector.intake.MutinyConnectorIntakeServiceGrpc.ConnectorIntakeServiceImplBase- Parameters:
request- request containing the session ID and optionalCrawlSummary- Returns:
- a
UniemittingEndCrawlSessionResponse
-
heartbeat
public io.smallrye.mutiny.Uni<ai.pipestream.connector.intake.HeartbeatResponse> heartbeat(ai.pipestream.connector.intake.HeartbeatRequest request) Heartbeat endpoint for long-running crawls.Validates that the session exists, updates its heartbeat timestamp, and returns a control command to the client. For now the command is always
COMMAND_CONTINUEwhen the session is valid; otherwiseCOMMAND_STOPis returned. Reactive semantics: executes on the default worker pool due to database access. Side effects: updates the session's last heartbeat time.- Overrides:
heartbeatin classai.pipestream.connector.intake.MutinyConnectorIntakeServiceGrpc.ConnectorIntakeServiceImplBase- Parameters:
request- heartbeat request containingsessionIdandcrawlId- Returns:
- a
Unithat emits the heartbeat response indicating session validity and next command
-