pub struct MemoryBoundedProcessor { /* private fields */ }Expand description
A memory-bounded stream processor that enforces a memory budget.
Processes edge events and maintains approximate graph statistics while staying within a configurable memory limit.
Implementations§
Source§impl MemoryBoundedProcessor
impl MemoryBoundedProcessor
Sourcepub fn new(config: MemoryBoundedConfig) -> Self
pub fn new(config: MemoryBoundedConfig) -> Self
Create a new memory-bounded processor.
Sourcepub fn process_edge(&mut self, src: usize, dst: usize, weight: f64)
pub fn process_edge(&mut self, src: usize, dst: usize, weight: f64)
Process an edge event, evicting old edges if memory budget is exceeded.
Sourcepub fn graph(&self) -> &StreamingGraph
pub fn graph(&self) -> &StreamingGraph
Get the current streaming graph.
Sourcepub fn edges_evicted(&self) -> u64
pub fn edges_evicted(&self) -> u64
Get the number of edges evicted.
Sourcepub fn estimated_memory(&self) -> usize
pub fn estimated_memory(&self) -> usize
Get estimated memory usage in bytes.
Sourcepub fn degree_distribution(&self) -> DegreeDistribution
pub fn degree_distribution(&self) -> DegreeDistribution
Get the degree distribution of the current graph.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryBoundedProcessor
impl RefUnwindSafe for MemoryBoundedProcessor
impl Send for MemoryBoundedProcessor
impl Sync for MemoryBoundedProcessor
impl Unpin for MemoryBoundedProcessor
impl UnsafeUnpin for MemoryBoundedProcessor
impl UnwindSafe for MemoryBoundedProcessor
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> 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 more