Skip to main content

Module state

Module state 

Source
Expand description

Typed GlobalState / LocalState arenas for per-execution operator state.

State ownership split:

  • GlobalState: hash build, global aggregate, sort runs, exchange, result collector — addressed by [PhysicalOperatorId].
  • LocalState: scan cursor, probe state, partial accumulator, expression workspace — addressed by (PhysicalOperatorId, TaskId).

State is kept separate from specs so that [PhysicalPlan] and [OperatorSpec] remain immutable and cacheable. State is allocated once per execution instance and indexed via typed arenas rather than inline fields, avoiding dyn Any downcast patterns.

Structs§

GlobalStateArena
Typed arena of global operator state objects.
GlobalStateKey
Key for indexing global state: the physical operator ID and partition. None identifies global or non-partitioned state.
LocalStateArena
Typed arena of per-task local operator state.
LocalStateKey
Key for indexing local state: operator ID + partition ID + task ID.
StateArenaSet
Combined set of global and local state arenas for an execution instance.

Enums§

GlobalState
Global operator state — lives for the duration of the query and is shared across all tasks/partitions that execute the same operator.
LocalState
Local (per-task) operator state — each task or partition gets its own copy. Lives for the duration of a single task execution.

Type Aliases§

TaskId
A task identifier within a fragment execution.