Class TailInitializationFilter
This is only designed to operate against a source table, if any rows are modified or removed from the table, then the ShiftObliviousListener throws an IllegalStateException. Each contiguous range of indices is assumed to be a partition. If you filter or otherwise alter the source table before calling TailInitializationFilter, this assumption will be violated and the resulting table will not be filtered as desired.
Once initialized, the filter returns all new rows, rows that have already been passed are not removed or modified.
The input must be sorted by Timestamp, or the resulting table is undefined. Null timestamps are not permitted.
For consistency, the last value of each partition is used to determine the threshold for that partition.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Table
mostRecent
(Table table, String timestampName, long nanos) Get the most recent rows from each partition in source table.static Table
mostRecent
(Table table, String timestampName, String period) Get the most recent rows from each partition in source table.
-
Constructor Details
-
TailInitializationFilter
public TailInitializationFilter()
-
-
Method Details
-
mostRecent
Get the most recent rows from each partition in source table.- Parameters:
table
- the source table to filtertimestampName
- the name of the timestamp columnperiod
- interval between the last row in a partition (as converted byDateTimeUtils.parseDurationNanos(String)
)- Returns:
- a table with only the most recent values in each partition
-
mostRecent
Get the most recent rows from each partition in source table.- Parameters:
table
- the source table to filtertimestampName
- the name of the timestamp columnnanos
- interval between the last row in a partition, in nanoseconds- Returns:
- a table with only the most recent values in each partition
-