Struct differential_dataflow::operators::arrange::Arranged
[−]
[src]
pub struct Arranged<G: Scope, T: Trace<Index=G::Timestamp>> where T::Key: Data, T::Value: Data, G::Timestamp: LeastUpperBound, &'a T: TraceRef<'a, T::Key, T::Index, T::Value> { pub stream: Stream<G, (Vec<T::Key>, Vec<u32>, Vec<(T::Value, i32)>)>, pub trace: Rc<RefCell<T>>, }
A collection of (K,V) values as a timely stream and shared trace.
An Arranged performs the task of arranging a keyed collection once,
allowing multiple differential operators to use the same trace. This
saves on computation and memory, in exchange for some cognitive overhead
in writing differential operators: each must pay enough care to signals
from the stream field to know the subset of trace it has logically
received.
Fields
stream: Stream<G, (Vec<T::Key>, Vec<u32>, Vec<(T::Value, i32)>)>
A stream containing arranged updates.
This stream may be reduced to just the keys, with the expectation that looking up the updated values in the associated trace should be more efficient than cloning the values. Users who need the values can obviously use the original stream.
trace: Rc<RefCell<T>>
A shared trace, updated by the Arrange operator and readable by others.
Methods
impl<G: Scope, T: Trace<Index=G::Timestamp>> Arranged<G, T> where T::Key: Data, T::Value: Data, G::Timestamp: LeastUpperBound, &'a T: TraceRef<'a, T::Key, T::Index, T::Value>[src]
fn as_collection(&self) -> Collection<G, (T::Key, T::Value)>
Flattens the stream into a Collection.
This operator is not obviously more efficient than using the Collection that is input
to the Arrange operator. However, this may be the only way to recover a collection from
only the Arranged type.
Trait Implementations
impl<G, K, L> ThresholdArranged<G, K> for Arranged<G, CountTrace<K, G::Timestamp, L>> where G: Scope, K: Data, L: Lookup<K, Offset> + 'static, G::Timestamp: LeastUpperBound[src]
fn threshold<U, KH, Look, LookG, Logic>(&self, key_h: KH, look: LookG, logic: Logic) -> Arranged<G, CountTrace<K, G::Timestamp, Look>> where U: Unsigned + Default, KH: Fn(&K) -> U + 'static, Look: Lookup<K, Offset> + 'static, LookG: Fn(u64) -> Look, Logic: Fn(&K, Delta) -> Delta + 'static
Groups arranged data using a key hash function, a lookup generator, and user logic. Read more
impl<G, K, V, L> GroupArranged<G, K, V> for Arranged<G, BasicTrace<K, G::Timestamp, V, L>> where G: Scope, K: Data, V: Data, L: Lookup<K, Offset> + 'static, G::Timestamp: LeastUpperBound[src]
fn group<V2, U, KH, Look, LookG, Logic>(&self, key_h: KH, look: LookG, logic: Logic) -> Arranged<G, BasicTrace<K, G::Timestamp, V2, Look>> where V2: Data, U: Unsigned + Default, KH: Fn(&K) -> U + 'static, Look: Lookup<K, Offset> + 'static, LookG: Fn(u64) -> Look, Logic: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, i32)>) + 'static
Groups arranged data using a key hash function, a lookup generator, and user logic. Read more
impl<TS: Timestamp, G: Scope<Timestamp=TS>, T: Trace<Index=TS> + 'static> JoinArranged<G, T::Key, T::Value> for Arranged<G, T> where G::Timestamp: LeastUpperBound, &'a T: TraceRef<'a, T::Key, T::Index, T::Value>[src]
fn join<T2, R, RF>(&self, other: &Arranged<G, T2>, result: RF) -> Collection<G, R> where T2: Trace<Key=T::Key, Index=G::Timestamp> + 'static, R: Data, RF: Fn(&T::Key, &T::Value, &T2::Value) -> R + 'static, &'a T2: TraceRef<'a, T2::Key, T2::Index, T2::Value>
Joins two arranged collections with the same key type. Read more