pub struct DistributedWindowAggregator { /* private fields */ }Expand description
Aggregates windowed results from multiple cluster nodes.
Collects partial results from each node and merges them into a global aggregate once all expected contributions arrive or a force-flush is triggered.
Implementations§
Source§impl DistributedWindowAggregator
impl DistributedWindowAggregator
Sourcepub fn new(expected_nodes: HashSet<String>, timeout: Duration) -> Self
pub fn new(expected_nodes: HashSet<String>, timeout: Duration) -> Self
Creates a new aggregator expecting results from the given nodes.
Sourcepub fn submit_partial(
&self,
partial: PartialWindowResult,
) -> DistributedResult<Option<AggregatedWindowResult>>
pub fn submit_partial( &self, partial: PartialWindowResult, ) -> DistributedResult<Option<AggregatedWindowResult>>
Submits a partial result from a node.
Returns Some(AggregatedWindowResult) if all expected nodes have now
contributed for this window; otherwise returns None.
Sourcepub fn force_aggregate(
&self,
window_id: u64,
) -> DistributedResult<AggregatedWindowResult>
pub fn force_aggregate( &self, window_id: u64, ) -> DistributedResult<AggregatedWindowResult>
Forces aggregation for a window even if not all nodes have contributed.
Sourcepub fn get_completed(&self, window_id: u64) -> Option<AggregatedWindowResult>
pub fn get_completed(&self, window_id: u64) -> Option<AggregatedWindowResult>
Returns a completed aggregate for a specific window, if available.
Sourcepub fn drain_completed(&self) -> Vec<AggregatedWindowResult>
pub fn drain_completed(&self) -> Vec<AggregatedWindowResult>
Drains and returns all completed window results in ascending window order.
Auto Trait Implementations§
impl Freeze for DistributedWindowAggregator
impl !RefUnwindSafe for DistributedWindowAggregator
impl Send for DistributedWindowAggregator
impl Sync for DistributedWindowAggregator
impl Unpin for DistributedWindowAggregator
impl UnsafeUnpin for DistributedWindowAggregator
impl !UnwindSafe for DistributedWindowAggregator
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> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.