pub struct TrackConsumersPool<I> { /* private fields */ }
Expand description
A MemoryPool
that tracks the consumers that have
reserved memory within the inner memory pool.
By tracking memory reservations more carefully this pool can provide better error messages on the largest memory users
Tracking is per hashed MemoryConsumer
, not per MemoryReservation
.
The same consumer can have multiple reservations.
Implementations§
Source§impl<I: MemoryPool> TrackConsumersPool<I>
impl<I: MemoryPool> TrackConsumersPool<I>
Sourcepub fn new(inner: I, top: NonZeroUsize) -> Self
pub fn new(inner: I, top: NonZeroUsize) -> Self
Creates a new TrackConsumersPool
.
The top
determines how many Top K MemoryConsumer
s to include
in the reported DataFusionError::ResourcesExhausted
.
Sourcepub fn report_top(&self, top: usize) -> String
pub fn report_top(&self, top: usize) -> String
The top consumers in a report string.
Trait Implementations§
Source§impl<I: Debug> Debug for TrackConsumersPool<I>
impl<I: Debug> Debug for TrackConsumersPool<I>
Source§impl<I: MemoryPool> MemoryPool for TrackConsumersPool<I>
impl<I: MemoryPool> MemoryPool for TrackConsumersPool<I>
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<I> !Freeze for TrackConsumersPool<I>
impl<I> !RefUnwindSafe for TrackConsumersPool<I>
impl<I> Send for TrackConsumersPool<I>where
I: Send,
impl<I> Sync for TrackConsumersPool<I>where
I: Sync,
impl<I> Unpin for TrackConsumersPool<I>where
I: Unpin,
impl<I> UnwindSafe for TrackConsumersPool<I>where
I: UnwindSafe,
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