Package com.inductiveautomation.historian.gateway.api.query.pipeline
package com.inductiveautomation.historian.gateway.api.query.pipeline
The query pipeline's public surface: a caller runs a query through
QueryPipeline, which resolves each
source's engine through a QueryEngineRouter, streams each
key's samples or engine rows as PipelineEvents, and hands assembled
Rows to a RowSink.
An aggregate the gateway computes is an AggregateFunction: a fold that
answers one whole window. It opens with the window's bounds, the sample in effect at the window
start and the query's quality filter, sees the sample after the window when it needs one, and
answers the window's edge values itself. The pipeline owns everything around the window: the
grid, the watermarks that close windows, the quality ledgers that stamp a gated fold's cell, and
the fill of a window the fold leaves without a cell.
-
ClassDescriptionAggregateFunction<ACC>Incremental fold over one window.One value of a finished window.
boolean-input convenience: coerces the sample and callsAggregateFunction.OfBoolean.addBoolean(ACC, boolean).double-input convenience: coerces the sample and callsAggregateFunction.OfDouble.addDouble(ACC, double).long-input convenience: coerces the sample (a floating one rounded half-even) and callsAggregateFunction.OfLong.addLong(ACC, long).A sample outside a window that bounds it: the latest sample strictly before the window start (a bounding seed before the query range or the last sample of an earlier window), or the first sample at or after its end.How a fold treats sample quality.What the pipeline needs to know about a fold: how it treats quality, whetherAggregateFunction.open(AggregateFunction.Window)reads its window (so the pipeline seeds the key and opens a window that has a prior but no samples), whether time after a window's last sample counts only onceAggregateFunction.close(ACC, AggregateFunction.PriorSample)supplies the sample after the window, and whether it reads the stored samples at its window's edges.The window a fold opens: its bounds in epoch milliseconds ([startMs, endMs), the end clipped to the query range), the sample in effect at its start when one is known, the levels the query's quality filter admits, and whether the signal ramps linearly between samples (sloped) or holds each value until the next.Type of one result column in aRowSchema: either a resolved tagDataTypeor theColumnType.Untyped.OBJECTsentinel for a column whose values are not of one type.Column whose every value has the same resolvedDataType.Sentinel for a column carrying values of more than oneDataType.Query envelope that carries different query options per engine in one pipeline call, instead of one call per engine.PipelineEvent<K extends DataPointQueryKey>An event flowing through the pipeline stages.PipelineEvent.KeyComplete<K extends DataPointQueryKey>Signals that the stream forPipelineEvent.KeyComplete.key()completed successfully.PipelineEvent.KeyFailure<K extends DataPointQueryKey>Signals that the stream forPipelineEvent.KeyFailure.key()failed with the given quality code.PipelineEvent.KeyOpen<K extends DataPointQueryKey>Signals that the stream of points forPipelineEvent.KeyOpen.key()has begun.Carries one point forPipelineEvent.Point.key().PipelineEvent.Watermark<K extends DataPointQueryKey>Advances the watermark forPipelineEvent.Watermark.key(): every later point has a timestamp at or afterPipelineEvent.Watermark.time().Resolves aQueryEnginefor a given source.Handle returned byQueryPipeline.run(DataPointQueryOptions, ResultWriterOptions, RowSink): completion, cancellation and progress.Runs queries through the modern pipeline and streams the assembled rows into aRowSink.Pipeline-wide tunables.Reads the current value of the live tag behind each historized path, which the pipeline offers as a query's post bound when no stored sample follows the range.Progress event emitted byQueryHandle.progress().Final result of aQueryPipelinerun.One assembled row emitted byRowAssemblerinto aRowSink.Wraps a row to stamp a non-nullengineIdon it for multi-engine attribution; every other accessor delegates to the wrapped row.Calculation row: one aggregate result per row, with thetimestampof the start of the window it finalized over.Tall-format row: one path, value and quality per row, with the aggregate that produced the value ornullfor a raw sample.Wide-format row: one timestamp, with parallel value and quality arrays per column.Describes the schema of rows emitted by aQueryPipeline.Terminal subscriber for assembledRows.Maps an event timestamp to the start of its window.Engine-suggested window size for aggregated queries with no explicit window, for example(endMs - startMs) / returnSize.Every event is its own window; for raw queries.Fixed-size, non-overlapping windows aligned tostartMs.Identifier for a closed time window:[startMs, endMs).