## Copyright (c) 2016-2025 Deephaven Data Labs and Patent Pending#"""This module defines the Barrier marker class and the ConcurrencyControl generic protocol that can be subclassed andimplemented by Selectable and Filter to provide explicit concurrency control during evaluation of the select, update,and where table operations.See https://deephaven.io/core/docs/conceptual/query-engine/parallelization/ for more details on concurrency control."""from__future__importannotationsfromabcimportabstractmethodfromtypingimportProtocol,Sequence,TypeVar,Unionimportjpyfromdeephaven._wrapperimportJObjectWrapper_J_Object=jpy.get_type("java.lang.Object")
[docs]classBarrier(JObjectWrapper):"""A hollow marker class representing a barrier. A barrier 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."""j_object_type=_J_Object@propertydefj_object(self)->jpy.JType:returnself.j_barrierdef__init__(self):# no parameter so not auto wrap-ableself.j_barrier=_J_Object()
T=TypeVar("T",covariant=True)
[docs]classConcurrencyControl(Protocol[T]):"""An abstract class representing concurrency control features for Selectable and Filter."""
[docs]@abstractmethoddefwith_declared_barriers(self,barriers:Union[Barrier,Sequence[Barrier]])->T:"""Returns a new instance with the given declared barriers."""
[docs]@abstractmethoddefwith_respected_barriers(self,barriers:Union[Barrier,Sequence[Barrier]])->T:"""Returns a new instance with the given respected barriers."""
[docs]@abstractmethoddefwith_serial(self)->T:"""Returns a new instance with column-wise serial evaluation enforced, i.e. rows in the column are guaranteed to evaluated in order."""