Trait differential_dataflow::operators::reduce::Threshold [−][src]
Extension trait for the threshold
and distinct
differential dataflow methods.
Required methods
fn threshold_named<R2: Abelian, F: FnMut(&K, &R1) -> R2 + 'static>(
&self,
name: &str,
thresh: F
) -> Collection<G, K, R2>
[src]
&self,
name: &str,
thresh: F
) -> Collection<G, K, R2>
A threshold
with the ability to name the operator.
Provided methods
fn threshold<R2: Abelian, F: FnMut(&K, &R1) -> R2 + 'static>(
&self,
thresh: F
) -> Collection<G, K, R2>
[src]
&self,
thresh: F
) -> Collection<G, K, R2>
Transforms the multiplicity of records.
The threshold
function is obliged to map R1::zero
to R2::zero
, or at
least the computation may behave as if it does. Otherwise, the transformation
can be nearly arbitrary: the code does not assume any properties of threshold
.
Examples
extern crate timely; extern crate differential_dataflow; use differential_dataflow::input::Input; use differential_dataflow::operators::Threshold; fn main() { ::timely::example(|scope| { // report at most one of each key. scope.new_collection_from(1 .. 10).1 .map(|x| x / 3) .threshold(|_,c| c % 2); }); }
fn distinct(&self) -> Collection<G, K, isize>
[src]
Reduces the collection to one occurrence of each distinct element.
Examples
extern crate timely; extern crate differential_dataflow; use differential_dataflow::input::Input; use differential_dataflow::operators::Threshold; fn main() { ::timely::example(|scope| { // report at most one of each key. scope.new_collection_from(1 .. 10).1 .map(|x| x / 3) .distinct(); }); }
fn distinct_core<R2: Abelian + From<i8>>(&self) -> Collection<G, K, R2>
[src]
Distinct for general integer differences.
This method allows distinct
to produce collections whose difference
type is something other than an isize
integer, for example perhaps an
i32
.
Implementors
impl<G: Scope, K: Data, T1, R1: Semigroup> Threshold<G, K, R1> for Arranged<G, T1> where
G::Timestamp: Lattice + Ord,
T1: TraceReader<Key = K, Val = (), Time = G::Timestamp, R = R1> + Clone + 'static,
T1::Batch: BatchReader<K, (), G::Timestamp, R1>,
T1::Cursor: Cursor<K, (), G::Timestamp, R1>,
[src]
G::Timestamp: Lattice + Ord,
T1: TraceReader<Key = K, Val = (), Time = G::Timestamp, R = R1> + Clone + 'static,
T1::Batch: BatchReader<K, (), G::Timestamp, R1>,
T1::Cursor: Cursor<K, (), G::Timestamp, R1>,
fn threshold_named<R2: Abelian, F: FnMut(&K, &R1) -> R2 + 'static>(
&self,
name: &str,
thresh: F
) -> Collection<G, K, R2>
[src]
&self,
name: &str,
thresh: F
) -> Collection<G, K, R2>
impl<G: Scope, K: ExchangeData + Hashable, R1: ExchangeData + Semigroup> Threshold<G, K, R1> for Collection<G, K, R1> where
G::Timestamp: Lattice + Ord,
[src]
G::Timestamp: Lattice + Ord,
fn threshold_named<R2: Abelian, F: FnMut(&K, &R1) -> R2 + 'static>(
&self,
name: &str,
thresh: F
) -> Collection<G, K, R2>
[src]
&self,
name: &str,
thresh: F
) -> Collection<G, K, R2>