Struct differential_dataflow::Collection
[−]
[src]
pub struct Collection<G: Scope, D: Data> { pub inner: Stream<G, (D, Delta)>, }
A mutable collection of values of type D
Fields
inner: Stream<G, (D, Delta)>
Underlying timely dataflow stream.
Methods
impl<G: Scope, D: Data> Collection<G, D>
[src]
fn new(stream: Stream<G, (D, Delta)>) -> Collection<G, D>
Creates a new collection from a timely dataflow stream.
fn map<D2: Data, L: Fn(D) -> D2 + 'static>(&self, logic: L) -> Collection<G, D2>
Applies the supplied function to each element of the collection.
fn map_in_place<L: Fn(&mut D) + 'static>(&self, logic: L) -> Collection<G, D>
Applies the supplied function to each element of the collection, re-using allocated memory.
fn flat_map<D2: Data, I: Iterator<Item = D2>, L: Fn(D) -> I + 'static>(
&self,
logic: L
) -> Collection<G, D2>
&self,
logic: L
) -> Collection<G, D2>
Applies the supplied function to each element of the collection.
fn negate(&self) -> Collection<G, D>
Negates the counts of each element in the collection.
fn filter<L: Fn(&D) -> bool + 'static>(&self, logic: L) -> Collection<G, D>
Retains only the elements of the collection satisifying the supplied predicate.
fn concat(&self, other: &Collection<G, D>) -> Collection<G, D>
Adds the counts of elements from each collection.
fn enter<'a, T: Timestamp>(
&self,
child: &Child<'a, G, T>
) -> Collection<Child<'a, G, T>, D>
&self,
child: &Child<'a, G, T>
) -> Collection<Child<'a, G, T>, D>
Brings a collection into a nested scope.
fn enter_at<'a, T: Timestamp, F>(
&self,
child: &Child<'a, G, T>,
initial: F
) -> Collection<Child<'a, G, T>, D> where
F: Fn(&(D, Delta)) -> T + 'static,
G::Timestamp: Hash,
T: Hash,
&self,
child: &Child<'a, G, T>,
initial: F
) -> Collection<Child<'a, G, T>, D> where
F: Fn(&(D, Delta)) -> T + 'static,
G::Timestamp: Hash,
T: Hash,
Brings a collection into a nested scope, at varying times.
The initial
function indicates the time at which each element of the collection should appear.
fn inspect<F: FnMut(&(D, Delta)) + 'static>(&self, func: F) -> Collection<G, D>
Applies a supplied function to each update. Diagnostic.
fn inspect_batch<F: FnMut(&G::Timestamp, &[(D, Delta)]) + 'static>(
&self,
func: F
) -> Collection<G, D>
&self,
func: F
) -> Collection<G, D>
Applies a supplied function to each batch of updates. Diagnostic.
fn probe(&self) -> (Handle<G::Timestamp>, Collection<G, D>)
Attaches a timely dataflow probe to the output of a collection.
This probe is used to determine when the state of the collection has stabilized and can be read out.
fn scope(&self) -> G
The scope containing the underlying timely dataflow stream.
impl<'a, G: Scope, T: Timestamp, D: Data> Collection<Child<'a, G, T>, D>
[src]
fn leave(&self) -> Collection<G, D>
Returns the final value of a collection from a nested scope to its containing scope.
Trait Implementations
impl<G: Scope, K: Data, V: Data> ArrangeByKey<G, K, V> for Collection<G, (K, V)> where
G::Timestamp: Lattice,
[src]
G::Timestamp: Lattice,
fn arrange_by_key<U: Unsigned + Default, KH: Fn(&K) -> U + 'static, Look: Lookup<K, Offset> + 'static, LookG: Fn(u64) -> Look>(
&self,
key_h: KH,
look: LookG
) -> Arranged<G, BasicTrace<K, G::Timestamp, V, Look>>
&self,
key_h: KH,
look: LookG
) -> Arranged<G, BasicTrace<K, G::Timestamp, V, Look>>
Arranges a stream of (Key, Val)
updates by Key
. Read more
impl<G: Scope, K: Data> ArrangeBySelf<G, K> for Collection<G, K> where
G::Timestamp: Lattice,
[src]
G::Timestamp: Lattice,
fn arrange_by_self<U: Unsigned + Default, KH: Fn(&K) -> U + 'static, Look: Lookup<K, Offset> + 'static, LookG: Fn(u64) -> Look>(
&self,
key_h: KH,
look: LookG
) -> Arranged<G, Count<K, G::Timestamp, Look>> where
G::Timestamp: Lattice,
&self,
key_h: KH,
look: LookG
) -> Arranged<G, Count<K, G::Timestamp, Look>> where
G::Timestamp: Lattice,
Arranges a stream of (Key, ()))
updates by Key
. Read more
impl<G: Scope, K: Data + Default> Threshold<G, K> for Collection<G, K> where
G::Timestamp: Lattice,
[src]
G::Timestamp: Lattice,
fn threshold<L>(&self, logic: L) -> Collection<G, K> where
L: Fn(&K, Delta) -> Delta + 'static,
L: Fn(&K, Delta) -> Delta + 'static,
Groups records by their first field, and applies reduction logic to the associated values. Read more
fn threshold_u<L>(&self, logic: L) -> Collection<G, K> where
K: Unsigned + Default,
L: Fn(&K, Delta) -> Delta + 'static,
K: Unsigned + Default,
L: Fn(&K, Delta) -> Delta + 'static,
Groups records by their first field, when this field implements Unsigned
. Read more
fn distinct(&self) -> Collection<G, K>
Collects distinct elements.
fn distinct_u(&self) -> Collection<G, K> where
K: Unsigned + Default,
K: Unsigned + Default,
Collects distinct elements, when they implement Unsigned
.
impl<G: Scope, K: Data + Default, V: Data + Default> Group<G, K, V> for Collection<G, (K, V)> where
G::Timestamp: Lattice,
[src]
G::Timestamp: Lattice,
fn group<L, V2: Data>(&self, logic: L) -> Collection<G, (K, V2)> where
L: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, Delta)>) + 'static,
L: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, Delta)>) + 'static,
Groups records by their first field, and applies reduction logic to the associated values. Read more
fn group_u<L, V2: Data>(&self, logic: L) -> Collection<G, (K, V2)> where
K: Unsigned + Default,
L: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, i32)>) + 'static,
K: Unsigned + Default,
L: Fn(&K, &mut CollectionIterator<DifferenceIterator<V>>, &mut Vec<(V2, i32)>) + 'static,
Groups records by their first field, when this field implements Unsigned
. Read more
impl<G: Scope, K: Data + Default> Count<G, K> for Collection<G, K> where
K: Unsigned + Default,
G::Timestamp: Lattice,
[src]
K: Unsigned + Default,
G::Timestamp: Lattice,
fn count(&self) -> Collection<G, (K, Delta)>
Counts the number of occurrences of each element.
fn count_u(&self) -> Collection<G, (K, Delta)>
Counts the number of occurrences of each unsigned element.
impl<G: Scope, D: Ord + Data + Debug> ConsolidateExt<D> for Collection<G, D>
[src]
fn consolidate(&self) -> Self
Aggregates the weights of equal records into at most one record. Read more
fn consolidate_by<U: Unsigned, F: Fn(&D) -> U + 'static>(&self, part: F) -> Self
Aggregates the weights of equal records into at most one record, partitions the data using the supplied partition function. Read more
impl<G: Scope, D: Ord + Data + Debug> IterateExt<G, D> for Collection<G, D>
[src]
fn iterate<F>(&self, logic: F) -> Collection<G, D> where
G::Timestamp: Lattice,
F: FnOnce(&Collection<Child<'a, G, u64>, D>) -> Collection<Child<'a, G, u64>, D>,
G::Timestamp: Lattice,
F: FnOnce(&Collection<Child<'a, G, u64>, D>) -> Collection<Child<'a, G, u64>, D>,
Iteratively apply logic
to the source collection until convergence.
impl<G: Scope, K: Data, V: Data> Join<G, K, V> for Collection<G, (K, V)> where
G::Timestamp: Lattice,
[src]
G::Timestamp: Lattice,
fn join_map<V2: Data, D: Data, R>(
&self,
other: &Collection<G, (K, V2)>,
logic: R
) -> Collection<G, D> where
R: Fn(&K, &V, &V2) -> D + 'static,
&self,
other: &Collection<G, (K, V2)>,
logic: R
) -> Collection<G, D> where
R: Fn(&K, &V, &V2) -> D + 'static,
Matches pairs of (key,val1)
and (key,val2)
records based on key
and applies a reduction function.
fn semijoin(&self, other: &Collection<G, K>) -> Collection<G, (K, V)>
Matches pairs (key,val1)
and key
based on key
, filtering the first collection by values present in the second. Read more
fn antijoin(&self, other: &Collection<G, K>) -> Collection<G, (K, V)>
Matches pairs (key,val1)
and key
based on key
, discarding values in the first collection if their key is present in the second. Read more
fn join_map_u<V2: Data, D: Data, R: Fn(&K, &V, &V2) -> D + 'static>(
&self,
other: &Collection<G, (K, V2)>,
logic: R
) -> Collection<G, D> where
K: Unsigned + Default,
&self,
other: &Collection<G, (K, V2)>,
logic: R
) -> Collection<G, D> where
K: Unsigned + Default,
Joins two collections with dense unsigned integer keys and then applies a map function. Read more
fn semijoin_u(&self, other: &Collection<G, K>) -> Collection<G, (K, V)> where
K: Unsigned + Default,
K: Unsigned + Default,
Semijoins a collection with dense unsigned integer keys against a set of such keys. Read more
fn antijoin_u(&self, other: &Collection<G, K>) -> Collection<G, (K, V)> where
K: Unsigned + Default,
K: Unsigned + Default,
Antijoins a collection with dense unsigned integer keys against a set of such keys. Read more
fn join<V2: Data>(
&self,
other: &Collection<G, (K, V2)>
) -> Collection<G, (K, V, V2)>
&self,
other: &Collection<G, (K, V2)>
) -> Collection<G, (K, V, V2)>
Matches pairs (key,val1)
and (key,val2)
based on key
. Read more
fn join_u<V2: Data>(
&self,
other: &Collection<G, (K, V2)>
) -> Collection<G, (K, V, V2)> where
K: Unsigned + Default,
&self,
other: &Collection<G, (K, V2)>
) -> Collection<G, (K, V, V2)> where
K: Unsigned + Default,
Joins two collections with dense unsigned integer keys. Read more
impl<G: Clone + Scope, D: Clone + Data> Clone for Collection<G, D>
[src]
fn clone(&self) -> Collection<G, D>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more