Package io.deephaven.engine.util
Class WindowCheck
java.lang.Object
io.deephaven.engine.util.WindowCheck
Adds a Boolean column that is true if a Timestamp is within the specified window.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
This interface is only for Deephaven internal use. -
Method Summary
Modifier and TypeMethodDescriptionstatic Table
addTimeWindow
(QueryTable table, String timestampColumn, long windowNanos, String inWindowColumn) Adds a Boolean column that is false when a timestamp column is older than windowNanos.static Pair<Table,
WindowCheck.TimeWindowListener> addTimeWindowInternal
(Clock clock, QueryTable table, String timestampColumn, long windowNanos, String inWindowColumn, boolean addToMonitor) SeeaddTimeWindow(QueryTable, String, long, String)
for a description, the internal version gives you access to the TimeWindowListener for unit testing purposes.
-
Method Details
-
addTimeWindow
public static Table addTimeWindow(QueryTable table, String timestampColumn, long windowNanos, String inWindowColumn) Adds a Boolean column that is false when a timestamp column is older than windowNanos.
If the timestamp is greater than or equal to the curent time - windowNanos, then the result column is true. If the timestamp is null; the InWindow value is null.
The resultant table ticks whenever the input table ticks, or modifies a row when it passes out of the window.
The timestamp column must be an Instant or a long value expressed as nanoseconds since the epoch.
- Parameters:
table
- the input tabletimestampColumn
- the timestamp column to monitor in tablewindowNanos
- how many nanoseconds in the past a timestamp can be before it is out of the windowinWindowColumn
- the name of the new Boolean column.- Returns:
- a new table that contains an in-window Boolean column
-
addTimeWindowInternal
@InternalUseOnly public static Pair<Table,WindowCheck.TimeWindowListener> addTimeWindowInternal(Clock clock, QueryTable table, String timestampColumn, long windowNanos, String inWindowColumn, boolean addToMonitor) SeeaddTimeWindow(QueryTable, String, long, String)
for a description, the internal version gives you access to the TimeWindowListener for unit testing purposes.- Parameters:
addToMonitor
- should we add this to the PeriodicUpdateGraph- Returns:
- a pair of the result table and the TimeWindowListener that drives it
-