pub struct OperatorBase {
pub plan_node_id: i64,
pub runtime: Option<Arc<ExecutionRuntime>>,
pub lifecycle: OperatorLifecycle,
pub is_global: bool,
pub partition_id: Option<usize>,
pub chunk_size: usize,
pub physical_operator_id: PhysicalOperatorId,
pub output_layout: Arc<SlotLayout>,
pub reset_used_fallback: bool,
}Fields§
§plan_node_id: i64§runtime: Option<Arc<ExecutionRuntime>>§lifecycle: OperatorLifecycle§is_global: boolWhether this operator produces global (merged) output. Local operators process one partition at a time.
partition_id: Option<usize>Local partition that owns this operator. None denotes a global or
non-partitioned operator.
chunk_size: usizeRows per chunk when this operator produces output. Source operators use this value directly; unary/blocking operators pass through whatever they receive from their child.
physical_operator_id: PhysicalOperatorIdUnique physical identity used for this operator’s mutable runtime state. Production materialization must provide the arena-assigned ID.
output_layout: Arc<SlotLayout>Immutable output layout supplied by the physical plan. Operators use this for chunks they construct themselves, including empty-result paths, rather than inferring schema from data rows.
reset_used_fallback: boolSet when a reset() call degraded to the transitional close + open
fallback for this operator (see StreamingExecutor::reset). Surfaced
in EXPLAIN as reset:fallback so un-resettable paths stay auditable.
Implementations§
Source§impl OperatorBase
impl OperatorBase
pub fn new(plan_node_id: i64) -> Self
Sourcepub fn state_arena(&self) -> MutexGuard<'_, StateArenaSet>
pub fn state_arena(&self) -> MutexGuard<'_, StateArenaSet>
Lock and return the partition-local operator state arena from the runtime.
Each partition gets its own arena so parallel workers don’t contend. Panics if no runtime is attached.
Sourcepub fn with_physical_operator_id(self, operator_id: PhysicalOperatorId) -> Self
pub fn with_physical_operator_id(self, operator_id: PhysicalOperatorId) -> Self
Override the tree-node identity with the arena-assigned physical operator identity. This is required by production materialization.
Sourcepub fn with_output_layout(self, output_layout: Arc<SlotLayout>) -> Self
pub fn with_output_layout(self, output_layout: Arc<SlotLayout>) -> Self
Attach the output contract layout during physical-plan materialization.
Sourcepub fn state_key(&self) -> GlobalStateKey
pub fn state_key(&self) -> GlobalStateKey
Return the GlobalStateKey for this operator’s slot.
Sourcepub fn take_state(&mut self) -> Option<GlobalState>
pub fn take_state(&mut self) -> Option<GlobalState>
Take the GlobalState out of the arena (for cleanup).
Sourcepub fn insert_state(&mut self, state: GlobalState)
pub fn insert_state(&mut self, state: GlobalState)
Insert a GlobalState into this operator’s slot in the runtime arena.
No-op when no runtime is attached (e.g. in unit tests that construct
executor trees directly without an ExecutionRuntime).
Sourcepub fn local_state_key(&self, task_id: TaskId) -> LocalStateKey
pub fn local_state_key(&self, task_id: TaskId) -> LocalStateKey
Return the LocalStateKey for this operator + task.
Sourcepub fn insert_local_state(&mut self, task_id: TaskId, state: LocalState)
pub fn insert_local_state(&mut self, task_id: TaskId, state: LocalState)
Insert a LocalState into the arena for a given task.
Sourcepub fn take_local_state(&mut self, task_id: TaskId) -> Option<LocalState>
pub fn take_local_state(&mut self, task_id: TaskId) -> Option<LocalState>
Take a LocalState out of the arena (for cleanup).
Sourcepub fn with_local_state<T, F>(&self, task_id: TaskId, f: F) -> Option<T>where
F: FnOnce(&mut LocalState) -> T,
pub fn with_local_state<T, F>(&self, task_id: TaskId, f: F) -> Option<T>where
F: FnOnce(&mut LocalState) -> T,
Access local state for a given task via a closure.
The closure receives Option<&mut LocalState> scoped within the
state arena lock. Returns the closure’s result.
pub fn with_chunk_size(self, chunk_size: usize) -> Self
pub fn with_runtime(self, rt: Option<Arc<ExecutionRuntime>>) -> Self
pub fn with_global(self, is_global: bool) -> Self
pub fn with_partition(self, partition_id: usize) -> Self
pub fn profile_key(&self) -> OperatorProfileKey
pub fn ensure_not_cancelled(&self) -> Result<(), QueryError>
pub fn record_profile_rows(&self, count: u64)
Sourcepub fn mark_profile_exhausted(&self)
pub fn mark_profile_exhausted(&self)
Mark this operator instance as ran-to-exhaustion in the profile.
Called when advance returns None: operators that never exhaust
were starved (Limit / early termination) and their partial counts
must not train the feedback loop.
pub fn register_resource<F>(&self, f: F)
Sourcepub fn spill_manager(&self) -> Option<Arc<SpillManager>>
pub fn spill_manager(&self) -> Option<Arc<SpillManager>>
Convenience accessor for the spill manager from the runtime.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OperatorBase
impl !UnwindSafe for OperatorBase
impl Freeze for OperatorBase
impl Send for OperatorBase
impl Sync for OperatorBase
impl Unpin for OperatorBase
impl UnsafeUnpin for OperatorBase
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.