Struct timely::progress::nested::reachability::Builder [] [src]

pub struct Builder<T: Timestamp> { /* fields omitted */ }

A topology builder, which can summarize reachability along paths.

A Builder takes descriptions of the nodes and edges in a graph, and compiles a static summary of the minimal actions a timestamp must endure going from any input or output port to a destination input port.

A graph is provides as (i) several indexed nodes, each with some number of input and output ports, and each with a summary of the internal paths connecting each input to each output, and (ii) a set of edges connecting output ports to input ports. Edges do not adjust timestamps; only nodes do this.

The resulting summary describes, for each origin port in the graph and destination input port, a set of incomparable path summaries, each describing what happens to a timestamp as it moves along the path. There may be multiple summaries for each part of origin and destination due to the fact that the actions on timestamps may not be totally ordered (e.g., "increment the timestamp" and "take the maximum of the timestamp and seven").

Examples

use timely::progress::frontier::Antichain;
use timely::progress::nested::subgraph::{Source, Target};
use timely::progress::nested::reachability::Builder;

// allocate a new empty topology builder.
let mut builder = Builder::<usize>::new();
 
// Each node with one input connected to one output.
builder.add_node(0, 1, 1, vec![vec![Antichain::from_elem(0)]]);
builder.add_node(1, 1, 1, vec![vec![Antichain::from_elem(0)]]);
builder.add_node(2, 1, 1, vec![vec![Antichain::from_elem(1)]]);

// Connect nodes in sequence, looping around to the first from the last.
builder.add_edge(Source { index: 0, port: 0}, Target { index: 1, port: 0} );
builder.add_edge(Source { index: 1, port: 0}, Target { index: 2, port: 0} );
builder.add_edge(Source { index: 2, port: 0}, Target { index: 0, port: 0} );

// Summarize reachability information.
let summary = builder.summarize();

Methods

impl<T: Timestamp> Builder<T>
[src]

[src]

Create a new empty topology builder.

[src]

Add links internal to operators.

This method overwrites any existing summary, instead of anything more sophisticated.

[src]

Add links between operators.

This method does not check that the associated nodes and ports exist. References to missing nodes or ports are discovered in build.

[src]

Compiles the current nodes and edges into immutable path summaries.

This method has the opportunity to perform some error checking that the path summaries are valid, including references to undefined nodes and ports, as well as self-loops with default summaries (a serious liveness issue).

Trait Implementations

impl<T: Clone + Timestamp> Clone for Builder<T> where
    T::Summary: Clone
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug + Timestamp> Debug for Builder<T> where
    T::Summary: Debug
[src]

[src]

Formats the value using the given formatter. Read more