Struct datafusion::execution::memory_pool::MemoryConsumer
source · pub struct MemoryConsumer { /* private fields */ }
Expand description
A memory consumer that can be tracked by MemoryReservation
in a MemoryPool
Implementations§
source§impl MemoryConsumer
impl MemoryConsumer
sourcepub fn new(name: impl Into<String>) -> Self
pub fn new(name: impl Into<String>) -> Self
Create a new empty MemoryConsumer
that can be grown using MemoryReservation
sourcepub fn with_can_spill(self, can_spill: bool) -> Self
pub fn with_can_spill(self, can_spill: bool) -> Self
Set whether this allocation can be spilled to disk
sourcepub fn register(self, pool: &Arc<dyn MemoryPool>) -> MemoryReservation
pub fn register(self, pool: &Arc<dyn MemoryPool>) -> MemoryReservation
Registers this MemoryConsumer
with the provided MemoryPool
returning
a MemoryReservation
that can be used to grow or shrink the memory reservation