Class SortedClockFilter

All Implemented Interfaces:
ConcurrencyControl<Filter>, Expression, Filter, LogOutputAppendable, LivenessManager, LivenessNode, LivenessReferent, ReindexingFilter, WhereFilter, NotificationQueue.Dependency, Serializable, Runnable

public class SortedClockFilter extends ClockFilter
This will filter a table on an Instant column for all rows greater than "now" according to a supplied clock. It requires sorting of the input table according to the specified timestamp column, leveraging this for a very efficient implementation (albeit one that requires sorting first) and an output sequence that is monotonically nondecreasing in the specified column.
See Also:
  • Constructor Details

    • SortedClockFilter

      public SortedClockFilter(@NotNull @NotNull String columnName, @NotNull @NotNull Clock clock, boolean refreshing)
  • Method Details

    • copy

      public SortedClockFilter copy()
      Description copied from interface: WhereFilter
      Create a copy of this WhereFilter.
      Returns:
      an independent copy of this WhereFilter.
    • requiresSorting

      public boolean requiresSorting()
      Returns:
      True iff getSortColumns will return a non-null, non-empty array of column names to sort on.
    • getSortColumns

      public String[] getSortColumns()
      Description copied from interface: ReindexingFilter
      Get the columns on which the input table should be sorted before filtering.
      Returns:
      Columns to sort on, or null if there are no such columns
    • sortingDone

      public void sortingDone()
      Description copied from interface: ReindexingFilter
      Advise this filter that sorting has been performed. requiresSorting must return false hereafter.
    • initializeAndGetInitialIndex

      @Nullable protected @Nullable WritableRowSet initializeAndGetInitialIndex(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet fullSet, @NotNull @NotNull Table table)
      Description copied from class: ClockFilter
      This method is called from the ClockFilter.filter(RowSet, RowSet, Table, boolean) method to initialize the filter's internal data structures.

      The filter permits parallelization, so it may be called from many initialization threads concurrently.

      Specified by:
      initializeAndGetInitialIndex in class ClockFilter
      Parameters:
      selection - the selection to be filtered
      fullSet - the full set of rows in the source table
      table - the table that is being filtered
      Returns:
      the rowset that matches the filter at initialization time
    • updateAndGetAddedIndex

      @Nullable protected @Nullable WritableRowSet updateAndGetAddedIndex()
      Description copied from class: ClockFilter
      This method is called from the ClockFilter.run() method as part of the update graph source refresh.

      This method is not called concurrently, because there are no updates from the source table.

      Specified by:
      updateAndGetAddedIndex in class ClockFilter