pub struct MultiStreamCoordinator<A: Float + Send + Sync> { /* private fields */ }Expand description
Multi-stream coordinator for synchronizing multiple data streams
Implementations§
Source§impl<A: Float + Send + Sync> MultiStreamCoordinator<A>
impl<A: Float + Send + Sync> MultiStreamCoordinator<A>
pub fn new(config: &StreamingConfig) -> Result<Self>
Sourcepub fn add_stream(
&mut self,
stream_id: String,
config: StreamConfig<A>,
priority: StreamPriority,
)
pub fn add_stream( &mut self, stream_id: String, config: StreamConfig<A>, priority: StreamPriority, )
Add a new stream
Sourcepub fn stream_id_of(point: &StreamingDataPoint<A>) -> &str
pub fn stream_id_of(point: &StreamingDataPoint<A>) -> &str
The logical stream a data point belongs to.
Sourcepub fn record_arrival(&mut self, point: &StreamingDataPoint<A>)
pub fn record_arrival(&mut self, point: &StreamingDataPoint<A>)
Record the arrival of one sample, registering its stream on first
sight (T13: nothing ever fed sync_buffer before, so every
coordination decision was made over permanently empty state).
Sourcepub fn stream_count(&self) -> usize
pub fn stream_count(&self) -> usize
Number of streams seen so far.
Sourcepub fn arrival_counts(&self) -> &HashMap<String, usize>
pub fn arrival_counts(&self) -> &HashMap<String, usize>
Samples observed per stream.
Sourcepub fn synchronization_skew_ms(&self) -> Option<f64>
pub fn synchronization_skew_ms(&self) -> Option<f64>
Measured spread between the newest arrival of the earliest stream and
that of the latest one, in milliseconds. None while fewer than two
streams have been seen (there is nothing to be out of sync with).
Sourcepub fn max_sync_window_ms(&self) -> u64
pub fn max_sync_window_ms(&self) -> u64
The configured synchronization window in milliseconds.
Sourcepub fn stream_freshness_weights(&self) -> HashMap<String, A>
pub fn stream_freshness_weights(&self) -> HashMap<String, A>
Per-stream freshness weights in (0, 1], computed from how stale each
stream’s newest sample is relative to the newest sample overall:
1 / (1 + lag / window). A stream that has stopped producing loses
influence smoothly instead of continuing to count as an equal.
Sourcepub fn load_balancing_strategy(&self) -> LoadBalancingStrategy
pub fn load_balancing_strategy(&self) -> LoadBalancingStrategy
The load balancing strategy in force.
Sourcepub fn set_load_balancing_strategy(&mut self, strategy: LoadBalancingStrategy)
pub fn set_load_balancing_strategy(&mut self, strategy: LoadBalancingStrategy)
Select the load balancing strategy.
Sourcepub fn coordinate_streams(&mut self) -> Result<Vec<StreamingDataPoint<A>>>
pub fn coordinate_streams(&mut self) -> Result<Vec<StreamingDataPoint<A>>>
Coordinate data from multiple streams
Auto Trait Implementations§
impl<A> Freeze for MultiStreamCoordinator<A>
impl<A> RefUnwindSafe for MultiStreamCoordinator<A>where
A: RefUnwindSafe,
impl<A> Send for MultiStreamCoordinator<A>
impl<A> Sync for MultiStreamCoordinator<A>
impl<A> Unpin for MultiStreamCoordinator<A>where
A: Unpin,
impl<A> UnsafeUnpin for MultiStreamCoordinator<A>
impl<A> UnwindSafe for MultiStreamCoordinator<A>where
A: UnwindSafe + RefUnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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
impl<T> Read<Exclusive, BecauseExclusive> 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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.