pub type StackedCollection<G, T> = Collection<G, T, Diff, TimelyStack<(T, <G as ScopeParent>::Timestamp, Diff)>>;
Aliased Type§
struct StackedCollection<G, T> {
pub inner: StreamCore<G, TimelyStack<(T, <G as ScopeParent>::Timestamp, i64)>>,
/* private fields */
}
Fields§
§inner: StreamCore<G, TimelyStack<(T, <G as ScopeParent>::Timestamp, i64)>>
The underlying timely dataflow stream.
This field is exposed to support direct timely dataflow manipulation when required, but it is not intended to be the idiomatic way to work with the collection.
Implementations
Source§impl<G, D, R, C> Collection<Child<'_, G, <G as ScopeParent>::Timestamp>, D, R, C>
impl<G, D, R, C> Collection<Child<'_, G, <G as ScopeParent>::Timestamp>, D, R, C>
Methods requiring a region as the scope.
Sourcepub fn leave_region(&self) -> Collection<G, D, R, C>
pub fn leave_region(&self) -> Collection<G, D, R, C>
Returns the value of a Collection from a nested region to its containing scope.
This method is a specialization of leave
to the case that of a nested region.
It removes the need for an operator that adjusts the timestamp.
Source§impl<G, D, R, C> Collection<G, D, R, C>where
G: Scope,
impl<G, D, R, C> Collection<G, D, R, C>where
G: Scope,
Sourcepub fn new(stream: StreamCore<G, C>) -> Collection<G, D, R, C>
pub fn new(stream: StreamCore<G, C>) -> Collection<G, D, R, C>
Creates a new Collection from a timely dataflow stream.
This method seems to be rarely used, with the as_collection
method on streams being a more
idiomatic approach to convert timely streams to collections. Also, the input::Input
trait
provides a new_collection
method which will create a new collection for you without exposing
the underlying timely stream at all.
Source§impl<G, D, R, C> Collection<G, D, R, C>
impl<G, D, R, C> Collection<G, D, R, C>
Sourcepub fn concat(&self, other: &Collection<G, D, R, C>) -> Collection<G, D, R, C>
pub fn concat(&self, other: &Collection<G, D, R, C>) -> Collection<G, D, R, C>
Creates a new collection accumulating the contents of the two collections.
Despite the name, differential dataflow collections are unordered. This method is so named because the implementation is the concatenation of the stream of updates, but it corresponds to the addition of the two collections.
§Examples
use differential_dataflow::input::Input;
::timely::example(|scope| {
let data = scope.new_collection_from(1 .. 10).1;
let odds = data.filter(|x| x % 2 == 1);
let evens = data.filter(|x| x % 2 == 0);
odds.concat(&evens)
.assert_eq(&data);
});
Sourcepub fn concatenate<I>(&self, sources: I) -> Collection<G, D, R, C>where
I: IntoIterator<Item = Collection<G, D, R, C>>,
pub fn concatenate<I>(&self, sources: I) -> Collection<G, D, R, C>where
I: IntoIterator<Item = Collection<G, D, R, C>>,
Creates a new collection accumulating the contents of the two collections.
Despite the name, differential dataflow collections are unordered. This method is so named because the implementation is the concatenation of the stream of updates, but it corresponds to the addition of the two collections.
§Examples
use differential_dataflow::input::Input;
::timely::example(|scope| {
let data = scope.new_collection_from(1 .. 10).1;
let odds = data.filter(|x| x % 2 == 1);
let evens = data.filter(|x| x % 2 == 0);
odds.concatenate(Some(evens))
.assert_eq(&data);
});
Sourcepub fn enter_region<'a>(
&self,
child: &Child<'a, G, <G as ScopeParent>::Timestamp>,
) -> Collection<Child<'a, G, <G as ScopeParent>::Timestamp>, D, R, C>
pub fn enter_region<'a>( &self, child: &Child<'a, G, <G as ScopeParent>::Timestamp>, ) -> Collection<Child<'a, G, <G as ScopeParent>::Timestamp>, D, R, C>
This method is a specialization of enter
to the case where the nested scope is a region.
It removes the need for an operator that adjusts the timestamp.
Sourcepub fn inspect_container<F>(&self, func: F) -> Collection<G, D, R, C>where
F: FnMut(Result<(&<G as ScopeParent>::Timestamp, &C), &[<G as ScopeParent>::Timestamp]>) + 'static,
pub fn inspect_container<F>(&self, func: F) -> Collection<G, D, R, C>where
F: FnMut(Result<(&<G as ScopeParent>::Timestamp, &C), &[<G as ScopeParent>::Timestamp]>) + 'static,
Applies a supplied function to each batch of updates.
This method is analogous to inspect
, but operates on batches and reveals the timestamp of the
timely dataflow capability associated with the batch of updates. The observed batching depends
on how the system executes, and may vary run to run.
§Examples
use differential_dataflow::input::Input;
::timely::example(|scope| {
scope.new_collection_from(1 .. 10).1
.map_in_place(|x| *x *= 2)
.filter(|x| x % 2 == 1)
.inspect_container(|event| println!("event: {:?}", event));
});
Sourcepub fn probe(&self) -> Handle<<G as ScopeParent>::Timestamp>
pub fn probe(&self) -> Handle<<G as ScopeParent>::Timestamp>
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.
Sourcepub fn probe_with(
&self,
handle: &Handle<<G as ScopeParent>::Timestamp>,
) -> Collection<G, D, R, C>
pub fn probe_with( &self, handle: &Handle<<G as ScopeParent>::Timestamp>, ) -> Collection<G, D, R, C>
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 all updates observed. In addition, a probe is also often use to limit the number of rounds of input in flight at any moment; a computation can wait until the probe has caught up to the input before introducing more rounds of data, to avoid swamping the system.
Sourcepub fn negate(&self) -> Collection<G, D, R, C>where
StreamCore<G, C>: Negate<G, C>,
pub fn negate(&self) -> Collection<G, D, R, C>where
StreamCore<G, C>: Negate<G, C>,
Creates a new collection whose counts are the negation of those in the input.
This method is most commonly used with concat
to get those element in one collection but not another.
However, differential dataflow computations are still defined for all values of the difference type R
,
including negative counts.
§Examples
use differential_dataflow::input::Input;
::timely::example(|scope| {
let data = scope.new_collection_from(1 .. 10).1;
let odds = data.filter(|x| x % 2 == 1);
let evens = data.filter(|x| x % 2 == 0);
odds.negate()
.concat(&data)
.assert_eq(&evens);
});
Trait Implementations
Source§impl<G, D, R, C> Clone for Collection<G, D, R, C>
impl<G, D, R, C> Clone for Collection<G, D, R, C>
Source§fn clone(&self) -> Collection<G, D, R, C>
fn clone(&self) -> Collection<G, D, R, C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more