Class OpenSearchPoller
java.lang.Object
ai.pipestream.module.pipelineprobe.pipelinecrawl.OpenSearchPoller
Polls opensearch-manager for per-crawl indexed-doc counts across the
whole index family (base +
--chunk--* + --vs--*). Used
by the orchestrator's OS-drain phase when OPENSEARCH_SINK is in
the run's effective steps — when it's not, the orchestrator polls the
TransportTestCounter
directly via SidecarTapPoller instead and never calls us.
One blocking gRPC call per tick. Caller MUST be on a virtual thread — the poll loop spins at ~2s cadence so each call parks for the gRPC round-trip then resumes; nothing wasteful on a VT.
Wiring: quarkus.grpc.clients.opensearch-manager.* +
quarkus.stork."opensearch-manager".* in application.properties.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne tick's view of the crawl's index family. -
Constructor Summary
ConstructorsConstructorDescriptionCreates the poller; its gRPC stub is injected and it is managed by CDI. -
Method Summary
Modifier and TypeMethodDescriptionlongcountForCrawl(String crawlId, String baseIndexName) Headline base-index count forcrawlId— kept for callers that only gate on the base index.familyCounts(String crawlId, String baseIndexName) Get per-index counts of docs indexed undercrawlIdacross thebaseIndexNamefamily.
-
Constructor Details
-
OpenSearchPoller
public OpenSearchPoller()Creates the poller; its gRPC stub is injected and it is managed by CDI.
-
-
Method Details
-
familyCounts
Get per-index counts of docs indexed undercrawlIdacross thebaseIndexNamefamily.- Parameters:
crawlId- the crawl id to count indexed docs forbaseIndexName- the base index name whose family to query- Returns:
- a snapshot of per-index counts across the family for this tick
- Throws:
IllegalStateException- on an outer failure (malformed family, OSM internal error) — the poll loop logs and retries
-
countForCrawl
Headline base-index count forcrawlId— kept for callers that only gate on the base index.- Parameters:
crawlId- the crawl id to count indexed docs forbaseIndexName- the base index name whose count to return- Returns:
- the doc count in the base index for this crawl
-