Interface ConcurrencyControl<T>

Type Parameters:
T - the type of the expression to which concurrency control is applied.
All Known Subinterfaces:
Filter, FormulaColumn, LiteralFilter, ReindexingFilter, Selectable, SelectColumn, WhereFilter
All Known Implementing Classes:
AbstractConditionFilter, AbstractFormulaColumn, AbstractRangeFilter, AutoTuningIncrementalReleaseFilter, BaseIncrementalReleaseFilter, ByteRangeFilter, CharRangeFilter, ClockFilter, ColumnName, ComparableRangeFilter, ComposedFilter, ConditionFilter, ConjunctiveFilter, DhFormulaColumn, DisjunctiveFilter, DoubleRangeFilter, DownsampledWhereFilter, DynamicWhereFilter, FilterAnd, FilterBase, FilterComparison, FilterIn, FilterIsNull, FilterNot, FilterOr, FilterPattern, FilterSerial, FilterWithDeclaredBarriers, FilterWithRespectedBarriers, FloatRangeFilter, FormulaColumnPython, Function, FunctionalColumn, FunctionalColumnLong, IncrementalReleaseFilter, InstantRangeFilter, IntRangeFilter, LongRangeFilter, MatchFilter, Method, MultiSourceFunctionalColumn, NullSelectColumn, RangeFilter, RawString, ReinterpretedColumn, RollingReleaseFilter, SelectColumnWithDeclaredBarriers, SelectColumnWithRespectedBarriers, ShortRangeFilter, SingleSidedComparableRangeFilter, SortedClockFilter, SourceColumn, SwitchColumn, TableTransformationColumn, TimeSeriesFilter, UnsortedClockFilter, VectorComponentFilterWrapper, WhereAllFilter, WhereFilterDelegatingBase, WhereFilterImpl, WhereFilterInvertedImpl, WhereFilterLivenessArtifactImpl, WhereFilterSerialImpl, WhereFilterWithDeclaredBarriersImpl, WhereFilterWithRespectedBarriersImpl, WhereNoneFilter

public interface ConcurrencyControl<T>
Provides concurrency control operations for expressions such as filters and selectables.

This interface allows the application of different concurrency strategies to an expression. Through the provided methods, clients can enforce serial execution, apply barrier constraints, and specify ordering of operations relative to barriers. This facilitates both intra- and inter-expression synchronization, ensuring that expressions can be executed without risking concurrent modifications or out-of-order processing when interacting with stateful parts of custom user code.

  • Method Summary

    Modifier and Type
    Method
    Description
    withDeclaredBarriers(Object... declaredBarriers)
    Designates the filter/selectable as declaring the specified barrier object(s).
    withRespectedBarriers(Object... respectedBarriers)
    Specifies that the filter/selectable should respect the ordering constraints of the given barriers.
    Applies serial concurrency control to the expression.
  • Method Details

    • withSerial

      T withSerial()
      Applies serial concurrency control to the expression.

      The serial wrapped filter/selectable is guaranteed to process exactly the set of rows as if any prior filters/selectables were applied, but it will do so in a serial manner. If this is a filter, then the expression will not evaluate additional rows or skip rows that future filters may eliminate. Take care when selecting marking filters/selectables as serial, as the operation will not be able to take advantage of powerful optimizations.

      • Concurrency impact: The expression will never be invoked concurrently with itself.
      • Intra-expression ordering impact: Rows are evaluated sequentially in row set order.
      • Inter-expression ordering impact: For a filter, serial acts as an absolute reordering barrier, ensuring that no parts of a filter are executed out of order relative to this serial wrapper.

        For selectables, additional ordering constraints are controlled by the value of the QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS. This is set by the property QueryTable.serialSelectImplicitBarriers (defaulting to the value of QueryTable.statelessSelectByDefault).

        If QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS is false, then no additional ordering between selectable expressions is imposed. As with every select or update call, if column B references column A, then the necessary inputs from column A are evaluated before column B is evaluated. To impose further ordering constraints, use barriers.

        If QueryTable.SERIAL_SELECT_IMPLICIT_BARRIERS is true, then a serial selectable is an absolute barrier with respect to all other serial selectables. This prohibits serial selectables from being evaluated concurrently, permitting them to access global state. Selectables that are not serial may be reordered with respect to a serial selectable.

      Returns:
      a new instance of T with serial concurrency control applied.
    • withDeclaredBarriers

      T withDeclaredBarriers(Object... declaredBarriers)
      Designates the filter/selectable as declaring the specified barrier object(s).

      A barrier does not affect concurrency but imposes an ordering constraint for the filters or selectables that respect the same barrier. When a filter/selectable is marked as respecting a barrier object, it indicates that the respecting filter/selectable will be executed entirely after the filter/selectable declaring the barrier.

      Each barrier must be unique and declared by at most one filter. Object equals and Object.hashCode() hashCode will be used to determine uniqueness and identification of barrier objects.

      Parameters:
      declaredBarriers - the unique barrier object identifiers
      Returns:
      a new instance of T with the declaredBarriers applied
    • withRespectedBarriers

      T withRespectedBarriers(Object... respectedBarriers)
      Specifies that the filter/selectable should respect the ordering constraints of the given barriers.

      Filters that define a barrier (using withDeclaredBarriers(Object...)) will be executed entirely before filters/selectables that respect that barrier.

      It is an error to respect a barrier that has not already been defined per the natural left to right ordering of filters/selectables at the operation level. This is to minimize the risk of user error as the API is loosely typed.

      Object equals and Object.hashCode() hashCode will be used to identify which barriers are respected.

      Parameters:
      respectedBarriers - the unique barrier object identifiers to respect
      Returns:
      a new instance of T with the respects barrier rule applied