Class TailInitializationFilter
This is only designed to operate against a source table, which must be add-only. If the Timestamp source is a
RegionedColumnSource, then each region is assumed to be a partition. Otherwise, each contiguous range of row
keys is assumed to be a partition.
If you alter the source table before calling TailInitializationFilter, these assumptions may 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.
Each partition in 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. As the partitions must be sorted, the last row in each partition must be the most recent timestamp within that partition. The provided period is subtracted from the timestamp; and a binary search is performed to identify rows that are within the window defined by period.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TablemostRecent(Table table, String timestampName, long nanos) Get the most recent rows from each partition in source table.static TablemostRecent(Table table, String timestampName, String period) Get the most recent rows from each partition in source table.static TablemostRecentRows(Table table, long rowCount) 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)) and rows that match the filter- 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 and rows that match the filter- Returns:
- a table with only the most recent values in each partition
-
mostRecentRows
Get the most recent rows from each partition in source table.- Parameters:
table- the source table to filterrowCount- the number of rows to include per partition- Returns:
- a table with only the most recent values in each partition
-