Interface ConcurrencyControl<T>
- Type Parameters:
T- the type of the expression to which concurrency control is applied.
- All Known Subinterfaces:
Filter,LiteralFilter,ReindexingFilter,WhereFilter
- All Known Implementing Classes:
AbstractConditionFilter,AbstractRangeFilter,AutoTuningIncrementalReleaseFilter,BaseIncrementalReleaseFilter,ByteRangeFilter,CharRangeFilter,ClockFilter,ComparableRangeFilter,ComposedFilter,ConditionFilter,ConjunctiveFilter,DisjunctiveFilter,DoubleRangeFilter,DownsampledWhereFilter,DynamicWhereFilter,FilterAnd,FilterBarrier,FilterBase,FilterComparison,FilterIn,FilterIsNull,FilterNot,FilterOr,FilterPattern,FilterRespectsBarrier,FilterSerial,FloatRangeFilter,Function,IncrementalReleaseFilter,InstantRangeFilter,IntRangeFilter,LongRangeFilter,MatchFilter,Method,RangeFilter,RawString,RollingReleaseFilter,ShortRangeFilter,SingleSidedComparableRangeFilter,SortedClockFilter,TimeSeriesFilter,UnsortedClockFilter,VectorComponentFilterWrapper,WhereAllFilter,WhereFilterBarrierImpl,WhereFilterDelegatingBase,WhereFilterImpl,WhereFilterInvertedImpl,WhereFilterLivenessArtifactImpl,WhereFilterRespectsBarrierImpl,WhereFilterSerialImpl,WhereNoneFilter
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 TypeMethodDescriptionrespectsBarriers(Object... barriers) Specifies that the filter/selectable should respect the ordering constraints of the given barriers.withBarriers(Object... barriers) Designates the filter/selectable as a barrier with the specified barrier object(s).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: Acts as an absolute reordering barrier, ensuring that no parts of a where/selectable clause are executed out of order relative to this serial wrapper.
- Returns:
- a new instance of T with serial concurrency control applied.
-
withBarriers
Designates the filter/selectable as a barrier with the specified barrier object(s).A barrier does not affect concurrency but imposes an ordering constraint for the filter/selectable 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
equalsandObject.hashCode()hashCode will be used to determine uniqueness and identification of barrier objects.- Parameters:
barriers- the unique barrier object identifiers- Returns:
- a new instance of T with the barriers applied
-
respectsBarriers
Specifies that the filter/selectable should respect the ordering constraints of the given barriers.Filters that define a barrier (using
withBarriers(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
equalsandObject.hashCode()hashCode will be used to identify which barriers are respected.- Parameters:
barriers- the unique barrier object identifiers to respect- Returns:
- a new instance of T with the respects barrier rule applied
-