pub struct FairSpillPool { /* private fields */ }
Expand description
A MemoryPool
that prevents spillable reservations from using more than
an even fraction of the available memory sans any unspillable reservations
(i.e. (pool_size - unspillable_memory) / num_spillable_reservations
)
This pool works best when you know beforehand the query has multiple spillable operators that will likely all need to spill. Sometimes it will cause spills even when there was sufficient memory (reserved for other operators) to avoid doing so.
┌───────────────────────z──────────────────────z───────────────┐
│ z z │
│ z z │
│ Spillable z Unspillable z Free │
│ Memory z Memory z Memory │
│ z z │
│ z z │
└───────────────────────z──────────────────────z───────────────┘
Unspillable memory is allocated in a first-come, first-serve fashion
Implementations§
Trait Implementations§
Source§impl Debug for FairSpillPool
impl Debug for FairSpillPool
Source§impl MemoryPool for FairSpillPool
impl MemoryPool for FairSpillPool
Source§fn register(&self, consumer: &MemoryConsumer)
fn register(&self, consumer: &MemoryConsumer)
Registers a new
MemoryConsumer
Read moreSource§fn unregister(&self, consumer: &MemoryConsumer)
fn unregister(&self, consumer: &MemoryConsumer)
Source§fn grow(&self, reservation: &MemoryReservation, additional: usize)
fn grow(&self, reservation: &MemoryReservation, additional: usize)
Source§fn shrink(&self, reservation: &MemoryReservation, shrink: usize)
fn shrink(&self, reservation: &MemoryReservation, shrink: usize)
Infallibly shrink the provided
reservation
by shrink
bytesAuto Trait Implementations§
impl !Freeze for FairSpillPool
impl !RefUnwindSafe for FairSpillPool
impl Send for FairSpillPool
impl Sync for FairSpillPool
impl Unpin for FairSpillPool
impl UnwindSafe for FairSpillPool
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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 more