pub struct TraceAgent<K, V, T, R, Tr>where
    T: Lattice + Ord + Clone + 'static,
    Tr: TraceReader<K, V, T, R>,
{ /* private fields */ }
Expand description

A TraceReader wrapper which can be imported into other dataflows.

The TraceAgent is the default trace type produced by arranged, and it can be extracted from the dataflow in which it was defined, and imported into other dataflows.

Implementations

Creates a new agent from a trace reader.

Attaches a new shared queue to the trace.

The queue will be immediately populated with existing historical batches from the trace, and until the reference is dropped the queue will receive new batches as produced by the source arrange operator.

Copies an existing collection into the supplied scope.

This method creates an Arranged collection that should appear indistinguishable from applying arrange directly to the source collection brought into the local scope. The only caveat is that the initial state of the collection is its current state, and updates occur from this point forward. The historical changes the collection experienced in the past are accumulated, and the distinctions from the initial collection are no longer evident.

The current behavior is that the introduced collection accumulates updates to some times less or equal to self.advance_frontier(). There is not currently a guarantee that the updates are accumulated to the frontier, and the resulting collection history may be weirdly partial until this point. In particular, the historical collection may move through configurations that did not actually occur, even if eventually arriving at the correct collection. This is probably a bug; although we get to the right place in the end, the intermediate computation could do something that the original computation did not, like diverge.

I would expect the semantics to improve to “updates are advanced to self.advance_frontier()”, which means the computation will run as if starting from exactly this frontier. It is not currently clear whose responsibility this should be (the trace/batch should only reveal these times, or an operator should know to advance times before using them).

Examples
extern crate timely;
extern crate differential_dataflow;

use timely::Configuration;
use differential_dataflow::input::Input;
use differential_dataflow::operators::arrange::ArrangeBySelf;
use differential_dataflow::operators::group::Group;
use differential_dataflow::trace::Trace;
use differential_dataflow::trace::implementations::ord::OrdValSpine;
use differential_dataflow::hashable::OrdWrapper;

fn main() {
    ::timely::execute(Configuration::Thread, |worker| {

        // create a first dataflow
        let mut trace = worker.dataflow::<u32,_,_>(|scope| {
            // create input handle and collection.
            scope.new_collection_from(0 .. 10).1
                 .arrange_by_self()
                 .trace
        });

        // do some work.
        worker.step();
        worker.step();

        // create a second dataflow
        worker.dataflow(move |scope| {
            trace.import(scope)
                 .group(move |_key, src, dst| dst.push((*src[0].0, 1)));
        });

    }).unwrap();
}

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Executes the destructor for this type. Read more
The type of an immutable collection of updates.
The type used to enumerate the collections contents.
Advances the frontier of times the collection must be correctly accumulable through. Read more
Reports the frontier from which all time comparisions should be accurate. Read more
Advances the frontier that may be used in cursor_through. Read more
Reports the frontier from which the collection may be subsetted. Read more
Acquires a cursor to the restriction of the collection’s contents to updates at times not greater or equal to an element of upper. Read more
Maps some logic across the batches the collection manages. Read more
Provides a cursor over updates contained in the trace.

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.