Trait datafusion::execution::memory_manager::MemoryConsumer
source · [−]pub trait MemoryConsumer: Send + Sync {
fn name(&self) -> String;
fn id(&self) -> &MemoryConsumerId;
fn memory_manager(&self) -> Arc<MemoryManager>;
fn type_(&self) -> &ConsumerType;
fn spill<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn mem_used(&self) -> usize;
fn partition_id(&self) -> usize { ... }
fn try_grow<'life0, 'async_trait>(
&'life0 self,
required: usize
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn shrink(&self, freed: usize) { ... }
}
Expand description
A memory consumer that either takes up memory (of type ConsumerType::Tracking
)
or grows/shrinks memory usage based on available memory (of type ConsumerType::Requesting
).
Required Methods
fn id(&self) -> &MemoryConsumerId
fn id(&self) -> &MemoryConsumerId
Unique id of the consumer
fn memory_manager(&self) -> Arc<MemoryManager>
fn memory_manager(&self) -> Arc<MemoryManager>
Ptr to MemoryManager
fn type_(&self) -> &ConsumerType
fn type_(&self) -> &ConsumerType
Type of the consumer
Spill in-memory buffers to disk, free memory, return the previous used
Provided Methods
fn partition_id(&self) -> usize
fn partition_id(&self) -> usize
Partition that the consumer belongs to
Grow memory by required
to buffer more data in memory,
this may trigger spill before grow when the memory threshold is
reached for this consumer.