IngestBuffer
このコンテンツはまだ日本語訳がありません。
Defined in: db/IngestBuffer.ts:17
Staging buffer for DuckDB ingestion.
Accumulates incoming data points and provides them in batches
via drain(). The drain pattern decouples data arrival from
DuckDB insertion timing (polling interval), avoiding the need
for index-based tracking.
Contract: t values pushed to this buffer MUST be strictly
monotonically increasing. Out-of-order data will be silently missed
by incremental queries. This is guaranteed by the orts simulator
(simulation time always advances). Consumers using uneri with other
data sources must enforce this property.
Type Parameters
Section titled “Type Parameters”T extends TimePoint = TimePoint
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IngestBuffer<
T>():IngestBuffer<T>
Returns
Section titled “Returns”IngestBuffer<T>
Accessors
Section titled “Accessors”latestT
Section titled “latestT”Get Signature
Section titled “Get Signature”get latestT():
number
Defined in: db/IngestBuffer.ts:112
The latest t value seen across all pushed points. Used for timeRange calculation in chart components. Returns -Infinity if no points have been pushed.
Returns
Section titled “Returns”number
pendingCount
Section titled “pendingCount”Get Signature
Section titled “Get Signature”get pendingCount():
number
Defined in: db/IngestBuffer.ts:103
Number of points waiting to be drained.
Returns
Section titled “Returns”number
Methods
Section titled “Methods”consumeRebuild()
Section titled “consumeRebuild()”consumeRebuild():
T[] |null
Defined in: db/IngestBuffer.ts:94
Consume a pending rebuild signal. Returns the rebuild data merged with any points pushed since markRebuild(), or null if no rebuild is pending. The rebuild flag and pending buffer are both cleared.
Returns
Section titled “Returns”T[] | null
drain()
Section titled “drain()”drain():
T[]
Defined in: db/IngestBuffer.ts:64
Drain all pending points, returning them and clearing the buffer. Returns an empty array if nothing is pending.
Returns
Section titled “Returns”T[]
markRebuild()
Section titled “markRebuild()”markRebuild(
fullData):void
Defined in: db/IngestBuffer.ts:79
Signal a full table rebuild. The tick loop should clear the DuckDB table
and insert the returned data from consumeRebuild().
Clears any stale pending points to prevent duplicates (fullData is the complete replacement dataset). Points pushed after this call are treated as genuinely new and will be included by consumeRebuild().
Parameters
Section titled “Parameters”fullData
Section titled “fullData”T[]
Returns
Section titled “Returns”void
prependMany()
Section titled “prependMany()”prependMany(
points):void
Defined in: db/IngestBuffer.ts:56
Prepend points to the front of the buffer.
Used for re-queuing failed insert batches: since new points may have
arrived in pending during the async insert, appending the failed
batch would break t-monotonicity. Prepending preserves order.
Parameters
Section titled “Parameters”points
Section titled “points”T[]
Returns
Section titled “Returns”void
push()
Section titled “push()”push(
point):void
Defined in: db/IngestBuffer.ts:23
Push a single point. Must satisfy t > latestT (strictly increasing).
Parameters
Section titled “Parameters”T
Returns
Section titled “Returns”void
pushMany()
Section titled “pushMany()”pushMany(
points):void
Defined in: db/IngestBuffer.ts:41
Push multiple points at once (appended to end).
Parameters
Section titled “Parameters”points
Section titled “points”T[]
Returns
Section titled “Returns”void