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) -> SpillManager
pub fn new(config: SpillConfig) -> SpillManager
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§fn default() -> SpillManager
fn default() -> SpillManager
Returns the “default value” for a type. Read more
Source§impl Drop for SpillManager
impl Drop for SpillManager
Auto Trait Implementations§
impl !Freeze for SpillManager
impl Forget for SpillManager
impl Move for SpillManager
impl RefUnwindSafe for SpillManagerwhere
RwLock<HashMap<String, SegmentInfo>>: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
RwLock<SpillStats>: RefUnwindSafe,
RwLock<VecDeque<String>>: RefUnwindSafe,
RwLock<HashSet<String>>: RefUnwindSafe,
impl Send for SpillManager
impl Sync for SpillManager
impl Unpin for SpillManager
impl UnsafeUnpin for SpillManagerwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
Align1<u8>: UnsafeUnpin,
PhantomData<(String, SegmentInfo)>: UnsafeUnpin,
Align8<usize>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
impl UnwindSafe for SpillManagerwhere
RawVecInner: UnwindSafe,
RwLock<HashMap<String, SegmentInfo>>: UnwindSafe,
Align8<usize>: UnwindSafe,
RwLock<SpillStats>: UnwindSafe,
RwLock<VecDeque<String>>: UnwindSafe,
RwLock<HashSet<String>>: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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