pub enum EngineMemory {
Unbounded,
Private(usize),
Shared {
pool: Arc<dyn MemoryPool>,
fair_share_bytes: usize,
},
}Expand description
Where an engine’s DataFusion execution memory comes from.
The distinction that matters is Private versus
Shared. An executor runs slots task fragments
at once; giving each its own pool means the process claims
slots × pool_size, which is how a container gets OOM-killed while every
individual pool still reports headroom. One pool shared by every task makes
the executor’s total execution memory a single hard number, and
FairSpillPool divides it live across whoever is actually running — a task
alone gets all of it, four tasks get a quarter each, and nobody has to
predict the concurrency in advance.
Variants§
Unbounded
DataFusion’s default unbounded pool: no accounting, no spill.
Private(usize)
A FairSpillPool of this size belonging to this engine alone.
Correct for one-engine-per-process deployments (embedded, gateway).
A pool shared with every other engine in this process.
fair_share_bytes is what this engine can expect when all slots are
busy. It sizes spill reservations only — the pool itself is the
shared object and is not bounded by this number.
Implementations§
Source§impl EngineMemory
impl EngineMemory
Sourcepub fn from_limit(bytes: Option<usize>) -> Self
pub fn from_limit(bytes: Option<usize>) -> Self
A private pool of bytes, or Unbounded
when there is no limit.
Build a pool of bytes intended to be shared by several engines.
The caller keeps the returned handle and passes clones of it in
EngineMemory::Shared, which is what bounds their combined execution
memory rather than each engine’s individually.
Sourcepub fn for_this_process() -> Self
pub fn for_this_process() -> Self
The default memory source for an engine built in this process: a share
of process_query_pool.
This is what makes the bound hold no matter how many engines a process
ends up with. A process can host the Flight SQL engine, several
executor task slots, and IVM tick engines at once; when each built its
own pool at a fraction of the container, the fractions summed past the
container and the container was OOM-killed while every pool still
reported headroom. One shared pool cannot oversubscribe, and
FairSpillPool divides it live — an engine running alone gets all of
it, so the bound costs nothing when there is no contention.
Sourcepub fn sizing_bytes(&self) -> Option<usize>
pub fn sizing_bytes(&self) -> Option<usize>
The byte figure that should size spill reservations and session config,
or None when execution memory is unbounded.
Trait Implementations§
Source§impl Clone for EngineMemory
impl Clone for EngineMemory
Source§fn clone(&self) -> EngineMemory
fn clone(&self) -> EngineMemory
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for EngineMemory
impl !UnwindSafe for EngineMemory
impl Freeze for EngineMemory
impl Send for EngineMemory
impl Sync for EngineMemory
impl Unpin for EngineMemory
impl UnsafeUnpin for EngineMemory
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request