Class OpenSearchPoller

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

@ApplicationScoped public class OpenSearchPoller extends Object
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.

  • Constructor Details

    • OpenSearchPoller

      public OpenSearchPoller()
      Creates the poller; its gRPC stub is injected and it is managed by CDI.
  • Method Details

    • familyCounts

      public OpenSearchPoller.FamilySnapshot familyCounts(String crawlId, String baseIndexName)
      Get per-index counts of docs indexed under crawlId across the baseIndexName family.
      Parameters:
      crawlId - the crawl id to count indexed docs for
      baseIndexName - 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

      public long countForCrawl(String crawlId, String baseIndexName)
      Headline base-index count for crawlId — kept for callers that only gate on the base index.
      Parameters:
      crawlId - the crawl id to count indexed docs for
      baseIndexName - the base index name whose count to return
      Returns:
      the doc count in the base index for this crawl