Class LiveGraphRegistry

java.lang.Object
io.jenkins.plugins.pipelinegraphview.livestate.LiveGraphRegistry

public final class LiveGraphRegistry extends Object
Singleton holding one LiveGraphState per in-progress run. Entries are created on demand by the listener / lifecycle code, removed on completion, and otherwise bounded by a Caffeine LRU so abandoned entries (deleted runs, listener bugs) don't leak.

Operator knobs:

  • io.jenkins.plugins.pipelinegraphview.livestate.LiveGraphRegistry.enabled (boolean, default true) — set to false to disable the live-state path entirely and force scanner fallback.
  • io.jenkins.plugins.pipelinegraphview.livestate.LiveGraphRegistry.size (int, default 512) — max concurrent in-progress runs tracked. Extra runs use the scanner path until an entry evicts.
  • Method Details

    • get

      public static LiveGraphRegistry get()
    • currentVersion

      public Long currentVersion(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
      Returns the state's current version, or null if there's no usable state (feature disabled, not populated, poisoned, or not yet ready). Cheap — lets callers short-circuit to cachedGraph(org.jenkinsci.plugins.workflow.job.WorkflowRun, long)/cachedAllSteps(org.jenkinsci.plugins.workflow.job.WorkflowRun, long) without paying for a full snapshot first.
    • snapshot

      public LiveGraphSnapshot snapshot(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
      Returns a snapshot of the live state for this run, or null if none exists (feature disabled, state never populated, state poisoned). Callers must treat null as "fall back to the scanner path."
    • cachedGraph

      public PipelineGraph cachedGraph(org.jenkinsci.plugins.workflow.job.WorkflowRun run, long minVersion)
      Returns a previously-cached PipelineGraph for this run if it was computed at or after minVersion, otherwise null. Use LiveGraphSnapshot.version() as the argument — cache entries older than the caller's snapshot are rejected.
    • cacheGraph

      public void cacheGraph(org.jenkinsci.plugins.workflow.job.WorkflowRun run, long version, PipelineGraph graph)
    • cachedAllSteps

      public PipelineStepList cachedAllSteps(org.jenkinsci.plugins.workflow.job.WorkflowRun run, long minVersion)
    • cacheAllSteps

      public void cacheAllSteps(org.jenkinsci.plugins.workflow.job.WorkflowRun run, long version, PipelineStepList steps)
    • graphComputeLock

      @CheckForNull public Object graphComputeLock(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
      Returns a per-run monitor that callers can synchronise on to dedup concurrent graph rebuilds. Null when the live state isn't present (caller just computes directly).
    • allStepsComputeLock

      @CheckForNull public Object allStepsComputeLock(org.jenkinsci.plugins.workflow.job.WorkflowRun run)
      See graphComputeLock(WorkflowRun) — the matching lock for the steps path.
    • warningActionCache

      @CheckForNull public WarningActionCache warningActionCache(org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
      Returns the WarningActionCache for this execution, or null when the live state isn't present. Callers fall back to uncached scans on null.
    • blockResolutionCache

      @CheckForNull public BlockResolutionCache blockResolutionCache(org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
      Returns the BlockResolutionCache for this execution, or null when the live state isn't present. Callers fall back to uncached resolution on null.
    • skippedStageCache

      @CheckForNull public SkippedStageCache skippedStageCache(org.jenkinsci.plugins.workflow.flow.FlowExecution execution)
      Returns the SkippedStageCache for this execution, or null when the live state isn't present. Callers fall back to uncached action-list walks on null.