pub struct Arranged<G: Scope, K, V, R, T>where
    G::Timestamp: Lattice + Ord,
    T: TraceReader<K, V, G::Timestamp, R> + Clone,
{ pub stream: Stream<G, T::Batch>, pub trace: T, }
Expand description

An arranged collection of (K,V) values.

An Arranged allows multiple differential operators to share the resources (communication, computation, memory) required to produce and maintain an indexed representation of a collection.

Fields

stream: Stream<G, T::Batch>

A stream containing arranged updates.

This stream contains the same batches of updates the trace itself accepts, so there should be no additional overhead to receiving these records. The batches can be navigated just as the batches in the trace, by key and by value.

trace: T

A shared trace, updated by the Arrange operator and readable by others.

Implementations

Brings an arranged collection into a nested scope.

This method produces a proxy trace handle that uses the same backing data, but acts as if the timestamps have all been extended with an additional coordinate with the default value. The resulting collection does not vary with the new timestamp coordinate.

Brings an arranged collection into a nested scope.

This method produces a proxy trace handle that uses the same backing data, but acts as if the timestamps have all been extended with an additional coordinate with the default value. The resulting collection does not vary with the new timestamp coordinate.

Filters an arranged collection.

This method produces a new arrangement backed by the same shared arrangement as self, paired with user-specified logic that can filter by key and value. The resulting collection is restricted to the keys and values that return true under the user predicate.

Examples
extern crate timely;
extern crate differential_dataflow;

use differential_dataflow::input::Input;
use differential_dataflow::operators::arrange::ArrangeByKey;

fn main() {
    ::timely::example(|scope| {

        let arranged =
        scope.new_collection_from(0 .. 10).1
             .map(|x| (x, x+1))
             .arrange_by_key();

        arranged
            .filter(|k,v| k == v)
            .as_collection(|k,v| (*k,*v))
            .assert_empty();
    });
}

Flattens the stream into a Collection.

The underlying Stream<G, BatchWrapper<T::Batch>> is a much more efficient way to access the data, and this method should only be used when the data need to be transformed or exchanged, rather than supplied as arguments to an operator using the same key-value structure.

Extracts elements from an arrangement as a collection.

The supplied logic may produce an iterator over output values, allowing either filtering or flat mapping as part of the extraction.

Report values associated with keys at certain times.

This method consumes a stream of (key, time) queries and reports the corresponding stream of (key, value, time, diff) accumulations in the self trace.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Counts the number of occurrences of each element. Read more
Counts the number of occurrences of each element. Read more
Groups records by their first field, and applies reduction logic to the associated values. Read more
Applies group to arranged data, and returns an arrangement of output data. Read more
Matches pairs (key,val1) and (key,val2) based on key and then applies a function. Read more
Matches pairs (key, val) and key based on key, producing the former with frequencies multiplied. Read more
Matches pairs (key, val) and key based on key, discarding values in the first collection if their key is present in the second. Read more
Matches pairs (key,val1) and (key,val2) based on key and then applies a function. Read more
Joins two arranged collections with the same key type. Read more
Transforms the multiplicity of records. Read more
Reduces the collection to one occurrence of each distinct element. Read more
Reduces the collection to one occurrence of each distinct element. Read more
Reduces the collection to one occurrence of each distinct element. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.