Class BoundingSearchWindow

java.lang.Object
com.inductiveautomation.historian.common.model.options.BoundingSearchWindow

public final class BoundingSearchWindow extends Object
Policy for the search horizon of a bounding-value read, shared by every consumer of BoundingOptions.lookback() and BoundingOptions.lookforward().

A bounding read asks for the nearest stored sample beyond a range boundary, and how far away it sits depends on whether the tag is still logging, not on the query. pick(Duration) therefore searches the whole permitted horizon unless the caller names a shorter one, which is honored as given with no lower bound.

The lookforward also limits the live tag value the pipeline offers as a post bound: a range that ended further back than it gets none.

MAX_LOOKBACK is a guard, not a tuning knob. The lookup is a nearest-first scan of one row, so a boundary with any sample inside the horizon costs one index seek however wide the horizon; only a boundary with no sample reads to the far edge, and partitions past the engine's retention are not there to read. The cap is wide enough that a tag logging a few times a year still resolves its anchor.

Stateless and immutable, so pick(Duration) is safe to call from any thread.

  • Field Details

    • MAX_LOOKBACK

      public static final Duration MAX_LOOKBACK
      The widest search horizon a bounding-value read may use.
    • DEFAULT_LOOKBACK

      public static final Duration DEFAULT_LOOKBACK
      The horizon used when the caller names none: the full MAX_LOOKBACK.
  • Method Details

    • pick

      public static Duration pick(@Nullable Duration callerOverride)
      Picks the search horizon: the caller's override if it is a positive duration, otherwise DEFAULT_LOOKBACK, capped at MAX_LOOKBACK either way.
      Parameters:
      callerOverride - the caller's horizon; null, zero and negative mean no preference
      Returns:
      the horizon, never longer than MAX_LOOKBACK