Class ActiveCrawlRegistry

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

@ApplicationScoped public class ActiveCrawlRegistry extends Object
Tracks the crawl_ids of pipeline-crawl runs that currently have an open observation stream (an in-flight OrchestrationDriver run).

The sidecar's PipelineEventsConsumer is a single boot-time Kafka consumer of the platform-wide pipeline-events audit topic — it sees every crawl's StepExecutionRecords, not just this sidecar's. To avoid accumulating counts for the entire platform's traffic, the consumer folds a record into the observation collector ONLY when its crawl_id is registered here. OrchestrationDriver registers a run's crawl_id when it starts and unregisters it when the run ends (success or failure), so the collector's memory is bounded to live runs.

  • Constructor Details

    • ActiveCrawlRegistry

      public ActiveCrawlRegistry()
      Default constructor for CDI.
  • Method Details

    • register

      public void register(String crawlId)
      Mark a crawl as having an open observation stream.
      Parameters:
      crawlId - the run's crawl id; null/blank is ignored
    • unregister

      public void unregister(String crawlId)
      Mark a crawl's observation stream as closed.
      Parameters:
      crawlId - the run's crawl id
    • isActive

      public boolean isActive(String crawlId)
      Reports whether the given crawl currently has an open observation stream.
      Parameters:
      crawlId - the crawl id from a pipeline-events record
      Returns:
      true if this crawl currently has an open observation stream
    • hasActiveCrawls

      public boolean hasActiveCrawls()
      Reports whether any crawl currently has an open observation stream.
      Returns:
      true if ANY crawl currently has an open observation stream — the leaked-run sweep refuses to run while one is live, since crawl ids and account ids aren't directly correlatable