Class UnsortedClockFilter

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

public class UnsortedClockFilter extends ClockFilter
This will filter a table on an Instant column for all rows greater than "now" according to a supplied clock. It does not require any pre-sorting of the input table, instead preserving relative order in the initial output and each subsequent run. Relative to SortedClockFilter, this implementation may require less overall storage and do less overall work for tables with relatively few monotonically nondecreasing ranges (that is, m (number of ranges) <<< n (size in rows)), but it will do more work on run().
See Also:
  • Constructor Details

    • UnsortedClockFilter

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

    • 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.
    • copy

      public UnsortedClockFilter copy()
      Description copied from interface: WhereFilter
      Create a copy of this WhereFilter.
      Returns:
      an independent copy of this WhereFilter.
    • 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