pub struct SpillManager { /* private fields */ }Expand description
Manages memory limits by spilling cold data to disk
Implementations§
Source§impl SpillManager
impl SpillManager
Sourcepub fn new(config: SpillConfig) -> Self
pub fn new(config: SpillConfig) -> Self
Create a new spill manager
Sourcepub fn register_segment(&self, name: &str, size: usize)
pub fn register_segment(&self, name: &str, size: usize)
Register a memory segment for tracking
Sourcepub fn unregister_segment(&self, name: &str)
pub fn unregister_segment(&self, name: &str)
Unregister a segment
Sourcepub fn update_size(&self, name: &str, new_size: usize)
pub fn update_size(&self, name: &str, new_size: usize)
Update segment size
Sourcepub fn needs_spill(&self) -> Option<Vec<String>>
pub fn needs_spill(&self) -> Option<Vec<String>>
Check if spilling is needed, return segments to spill
Sourcepub fn spill(&self, name: &str, data: &[u8]) -> Result<PathBuf, SpillError>
pub fn spill(&self, name: &str, data: &[u8]) -> Result<PathBuf, SpillError>
Spill a segment to disk
Sourcepub fn reload(&self, name: &str) -> Result<Option<Vec<u8>>, SpillError>
pub fn reload(&self, name: &str) -> Result<Option<Vec<u8>>, SpillError>
Reload a spilled segment from disk
Sourcepub fn is_spilled(&self, name: &str) -> bool
pub fn is_spilled(&self, name: &str) -> bool
Check if a segment is spilled
Sourcepub fn stats(&self) -> SpillStats
pub fn stats(&self) -> SpillStats
Get current statistics
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get current memory usage
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Get memory utilization (0.0-1.0)
Trait Implementations§
Source§impl Default for SpillManager
impl Default for SpillManager
Source§impl Drop for SpillManager
impl Drop for SpillManager
Auto Trait Implementations§
impl !Freeze for SpillManager
impl RefUnwindSafe for SpillManager
impl Send for SpillManager
impl Sync for SpillManager
impl Unpin for SpillManager
impl UnsafeUnpin for SpillManager
impl UnwindSafe for SpillManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request