Class RollingReleaseFilter

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

public class RollingReleaseFilter extends WhereFilterLivenessArtifactImpl implements Runnable, NotificationQueue.Dependency
This will filter a table starting off with the first N rows, and then adding new rows to the table on each run.
See Also:
  • Constructor Details

    • RollingReleaseFilter

      public RollingReleaseFilter(long workingSize, long rollingSize)
  • Method Details

    • getColumns

      public List<String> getColumns()
      Description copied from interface: WhereFilter
      Get the columns required by this select filter.

      This filter must already be initialized before calling this method.

      Specified by:
      getColumns in interface WhereFilter
      Returns:
      the columns used as input by this select filter.
    • getColumnArrays

      public List<String> getColumnArrays()
      Description copied from interface: WhereFilter
      Get the array columns required by this select filter.

      This filter must already be initialized before calling this method.

      Specified by:
      getColumnArrays in interface WhereFilter
      Returns:
      the columns used as array input by this select filter.
    • init

      public void init(@NotNull @NotNull TableDefinition tableDefinition)
      Description copied from interface: WhereFilter
      Initialize this filter given the table definition. If this filter has already been initialized, this should be a no-op, or optionally validate that the table definition is compatible with previous initialization.
      Specified by:
      init in interface WhereFilter
      Parameters:
      tableDefinition - the definition of the table that will be filtered
    • filter

      @NotNull public @NotNull WritableRowSet filter(@NotNull @NotNull RowSet selection, @NotNull @NotNull RowSet fullSet, @NotNull @NotNull Table table, boolean usePrev)
      Description copied from interface: WhereFilter
      Filter selection to only matching rows.
      Specified by:
      filter in interface WhereFilter
      Parameters:
      selection - the indices that should be filtered. The selection must be a subset of fullSet, and may include rows that the engine determines need not be evaluated to produce the result. Implementations may not mutate or close selection.
      fullSet - the complete RowSet of the table to filter. The fullSet is used for calculating variables like "i" or "ii". Implementations may not mutate or close fullSet.
      table - the table to filter
      usePrev - true if previous values should be used. Implementing previous value filtering is optional, and a WhereFilter.PreviousFilteringNotSupported exception may be thrown. If a PreviousFiltering exception is thrown, then the caller must acquire the PeriodicUpdateGraph lock.
      Returns:
      The subset of selection accepted by this filter; ownership passes to the caller
    • isSimpleFilter

      public boolean isSimpleFilter()
      Specified by:
      isSimpleFilter in interface WhereFilter
      Returns:
      true if this is a filter that does not require any code execution, but rather is handled entirely within the database engine.
    • setRecomputeListener

      public void setRecomputeListener(WhereFilter.RecomputeListener listener)
      Description copied from interface: WhereFilter
      Set the WhereFilter.RecomputeListener that should be notified if results based on this WhereFilter must be recomputed.
      Specified by:
      setRecomputeListener in interface WhereFilter
      Parameters:
      listener - The WhereFilter.RecomputeListener to notify
    • satisfied

      public boolean satisfied(long step)
      Description copied from interface: NotificationQueue.Dependency
      Is this ancestor satisfied? Note that this method must be safe to call on any thread.
      Specified by:
      satisfied in interface NotificationQueue.Dependency
      Parameters:
      step - The step for which we are testing satisfaction
      Returns:
      Whether the dependency is satisfied on step (and will not fire subsequent notifications)
    • getUpdateGraph

      public UpdateGraph getUpdateGraph()
      Specified by:
      getUpdateGraph in interface NotificationQueue.Dependency
      Returns:
      the update graph that this dependency is a part of
    • copy

      public RollingReleaseFilter copy()
      Description copied from interface: WhereFilter
      Create a copy of this WhereFilter.
      Specified by:
      copy in interface WhereFilter
      Returns:
      an independent copy of this WhereFilter.
    • isRefreshing

      public boolean isRefreshing()
      Description copied from interface: WhereFilter
      Is this filter refreshing?
      Specified by:
      isRefreshing in interface WhereFilter
      Returns:
      if this filter is refreshing
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • destroy

      protected void destroy()
      Description copied from class: ReferenceCountedLivenessReferent
      Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().

      This is intended to only ever be used as a side effect of decreasing the reference count to 0.

      Overrides:
      destroy in class ReferenceCountedLivenessReferent
    • permitParallelization

      public boolean permitParallelization()
      Specified by:
      permitParallelization in interface WhereFilter
      Returns:
      if this filter can be applied in parallel