pub struct MemoryPolicy { /* private fields */ }Expand description
Memory accounting policy used by streaming SQL operators.
Implementations§
Source§impl MemoryPolicy
impl MemoryPolicy
Sourcepub fn new(limit_bytes: Option<u64>, spill_policy: SpillPolicy) -> MemoryPolicy
pub fn new(limit_bytes: Option<u64>, spill_policy: SpillPolicy) -> MemoryPolicy
Create a memory policy with an optional byte limit and spill behavior.
Sourcepub fn limit_bytes(&self) -> Option<u64>
pub fn limit_bytes(&self) -> Option<u64>
Return the configured byte limit, if any.
Sourcepub fn spill_policy(&self) -> &SpillPolicy
pub fn spill_policy(&self) -> &SpillPolicy
Return the configured spill behavior.
Sourcepub fn with_metrics(self, metrics: Arc<dyn SpillMetricsSink>) -> MemoryPolicy
pub fn with_metrics(self, metrics: Arc<dyn SpillMetricsSink>) -> MemoryPolicy
Attach a metrics sink to this policy.
Sourcepub fn spill_directory(&self) -> Option<&Path>
pub fn spill_directory(&self) -> Option<&Path>
Return the spill directory when disk spilling is enabled.
Sourcepub fn record_spill(&self, bytes: u64, files: u64)
pub fn record_spill(&self, bytes: u64, files: u64)
Record a spill through the configured metrics sink, when present.
Sourcepub fn over_limit(&self, used_bytes: u64) -> bool
pub fn over_limit(&self, used_bytes: u64) -> bool
Return whether used_bytes exceeds the configured limit.
Trait Implementations§
Source§impl Clone for MemoryPolicy
impl Clone for MemoryPolicy
Source§fn clone(&self) -> MemoryPolicy
fn clone(&self) -> MemoryPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for MemoryPolicy
impl !UnwindSafe for MemoryPolicy
impl Freeze for MemoryPolicy
impl Send for MemoryPolicy
impl Sync for MemoryPolicy
impl Unpin for MemoryPolicy
impl UnsafeUnpin for MemoryPolicy
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