Trait differential_dataflow::trace::TraceReader[][src]

pub trait TraceReader {
    type Key;
    type Val;
    type Time;
    type R;
    type Batch: BatchReader<Self::Key, Self::Val, Self::Time, Self::R> + Clone + 'static;
    type Cursor: Cursor<Self::Key, Self::Val, Self::Time, Self::R>;
    fn cursor_through(
        &mut self,
        upper: AntichainRef<'_, Self::Time>
    ) -> Option<(Self::Cursor, <Self::Cursor as Cursor<Self::Key, Self::Val, Self::Time, Self::R>>::Storage)>;
fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, Self::Time>);
fn get_logical_compaction(&mut self) -> AntichainRef<'_, Self::Time>;
fn set_physical_compaction(
        &mut self,
        frontier: AntichainRef<'_, Self::Time>
    );
fn get_physical_compaction(&mut self) -> AntichainRef<'_, Self::Time>;
fn map_batches<F: FnMut(&Self::Batch)>(&self, f: F); fn cursor(
        &mut self
    ) -> (Self::Cursor, <Self::Cursor as Cursor<Self::Key, Self::Val, Self::Time, Self::R>>::Storage) { ... }
fn advance_by(&mut self, frontier: AntichainRef<'_, Self::Time>) { ... }
fn advance_frontier(&mut self) -> AntichainRef<'_, Self::Time> { ... }
fn distinguish_since(&mut self, frontier: AntichainRef<'_, Self::Time>) { ... }
fn distinguish_frontier(&mut self) -> AntichainRef<'_, Self::Time> { ... }
fn read_upper(&mut self, target: &mut Antichain<Self::Time>)
    where
        Self::Time: Timestamp
, { ... }
fn advance_upper(&mut self, upper: &mut Antichain<Self::Time>)
    where
        Self::Time: Timestamp
, { ... } }

A trace whose contents may be read.

This is a restricted interface to the more general Trace trait, which extends this trait with further methods to update the contents of the trace. These methods are used to examine the contents, and to update the reader’s capabilities (which may release restrictions on the mutations to the underlying trace and cause work to happen).

Associated Types

type Key[src]

Key by which updates are indexed.

type Val[src]

Values associated with keys.

type Time[src]

Timestamps associated with updates

type R[src]

Associated update.

type Batch: BatchReader<Self::Key, Self::Val, Self::Time, Self::R> + Clone + 'static[src]

The type of an immutable collection of updates.

type Cursor: Cursor<Self::Key, Self::Val, Self::Time, Self::R>[src]

The type used to enumerate the collections contents.

Loading content...

Required methods

fn cursor_through(
    &mut self,
    upper: AntichainRef<'_, Self::Time>
) -> Option<(Self::Cursor, <Self::Cursor as Cursor<Self::Key, Self::Val, Self::Time, Self::R>>::Storage)>
[src]

Acquires a cursor to the restriction of the collection’s contents to updates at times not greater or equal to an element of upper.

This method is expected to work if called with an upper that (i) was an observed bound in batches from the trace, and (ii) the trace has not been advanced beyond upper. Practically, the implementation should be expected to look for a “clean cut” using upper, and if it finds such a cut can return a cursor. This should allow upper such as &[] as used by self.cursor(), though it is difficult to imagine other uses.

fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, Self::Time>)[src]

Advances the frontier that constrains logical compaction.

Logical compaction is the ability of the trace to change the times of the updates it contains. Update times may be changed as long as their comparison to all query times beyond the logical compaction frontier remains unchanged. Practically, this means that groups of timestamps not beyond the frontier can be coalesced into fewer representative times.

Logical compaction is important, as it allows the trace to forget historical distinctions between update times, and maintain a compact memory footprint over an unbounded update history.

By advancing the logical compaction frontier, the caller unblocks merging of otherwise equivalent udates, but loses the ability to observe historical detail that is not beyond frontier.

It is an error to call this method with a frontier not beyond the most recent arguments to this method, or the initial value of get_logical_compaction() if this method has not yet been called.

fn get_logical_compaction(&mut self) -> AntichainRef<'_, Self::Time>[src]

Reports the logical compaction frontier.

All update times beyond this frontier will be presented with their original times, and all update times not beyond this frontier will present as a time that compares identically with all query times beyond this frontier. Practically, update times not beyond this frontier should not be taken to be accurate as presented, and should be used carefully, only in accumulation to times that are beyond the frontier.

fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Self::Time>)[src]

Advances the frontier that constrains physical compaction.

Physical compaction is the ability of the trace to merge the batches of updates it maintains. Physical compaction does not change the updates or their timestamps, although it is also the moment at which logical compaction is most likely to happen.

Physical compaction allows the trace to maintain a logarithmic number of batches of updates, which is what allows the trace to provide efficient random access by keys and values.

By advancing the physical compaction frontier, the caller unblocks the merging of batches of updates, but loses the ability to create a cursor through any frontier not beyond frontier.

It is an error to call this method with a frontier not beyond the most recent arguments to this method, or the initial value of get_physical_compaction() if this method has not yet been called.

fn get_physical_compaction(&mut self) -> AntichainRef<'_, Self::Time>[src]

Reports the physical compaction frontier.

All batches containing updates beyond this frontier will not be merged with ohter batches. This allows the caller to create a cursor through any frontier beyond the physical compaction frontier, with the cursor_through() method. This functionality is primarily of interest to the join operator, and any other operators who need to take notice of the physical structure of update batches.

fn map_batches<F: FnMut(&Self::Batch)>(&self, f: F)[src]

Maps logic across the non-empty sequence of batches in the trace.

This is currently used only to extract historical data to prime late-starting operators who want to reproduce the stream of batches moving past the trace. It could also be a fine basis for a default implementation of the cursor methods, as they (by default) just move through batches accumulating cursors into a cursor list.

Loading content...

Provided methods

fn cursor(
    &mut self
) -> (Self::Cursor, <Self::Cursor as Cursor<Self::Key, Self::Val, Self::Time, Self::R>>::Storage)
[src]

Provides a cursor over updates contained in the trace.

fn advance_by(&mut self, frontier: AntichainRef<'_, Self::Time>)[src]

👎 Deprecated since 0.11:

please use set_logical_compaction

Deprecated form of set_logical_compaction.

fn advance_frontier(&mut self) -> AntichainRef<'_, Self::Time>[src]

👎 Deprecated since 0.11:

please use get_logical_compaction

Deprecated form of get_logical_compaction.

fn distinguish_since(&mut self, frontier: AntichainRef<'_, Self::Time>)[src]

👎 Deprecated since 0.11:

please use set_physical_compaction

Deprecated form of set_physical_compaction.

fn distinguish_frontier(&mut self) -> AntichainRef<'_, Self::Time>[src]

👎 Deprecated since 0.11:

please use get_physical_compaction

Deprecated form of get_physical_compaction.

fn read_upper(&mut self, target: &mut Antichain<Self::Time>) where
    Self::Time: Timestamp
[src]

Reads the upper frontier of committed times.

fn advance_upper(&mut self, upper: &mut Antichain<Self::Time>) where
    Self::Time: Timestamp
[src]

Advances upper by any empty batches.

An empty batch whose batch.lower bound equals the current contents of upper will advance upper to batch.upper. Taken across all batches, this should advance upper across empty batch regions.

Loading content...

Implementors

impl<K, V, T, R, B> TraceReader for Spine<K, V, T, R, B> where
    K: Ord + Clone,
    V: Ord + Clone,
    T: Lattice + Timestamp + Ord + Clone + Debug,
    R: Semigroup,
    B: Batch<K, V, T, R> + Clone + 'static, 
[src]

type Key = K

type Val = V

type Time = T

type R = R

type Batch = B

type Cursor = CursorList<K, V, T, R, <B as BatchReader<K, V, T, R>>::Cursor>

impl<Tr> TraceReader for TraceAgent<Tr> where
    Tr: TraceReader,
    Tr::Time: Lattice + Ord + Clone + 'static, 
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = Tr::Time

type R = Tr::R

type Batch = Tr::Batch

type Cursor = Tr::Cursor

impl<Tr> TraceReader for TraceFrontier<Tr> where
    Tr: TraceReader,
    Tr::Batch: Clone,
    Tr::Key: 'static,
    Tr::Val: 'static,
    Tr::Time: Timestamp + Lattice,
    Tr::R: 'static, 
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = Tr::Time

type R = Tr::R

type Batch = BatchFrontier<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Batch>

type Cursor = CursorFrontier<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Cursor>

impl<Tr> TraceReader for TraceRc<Tr> where
    Tr::Time: Lattice + Ord + Clone + 'static,
    Tr: TraceReader
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = Tr::Time

type R = Tr::R

type Batch = Tr::Batch

type Cursor = Tr::Cursor

fn set_logical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>)[src]

Sets frontier to now be elements in frontier.

This change may not have immediately observable effects. It informs the shared trace that this handle no longer requires access to times other than those in the future of frontier, but if there are other handles to the same trace, it may not yet be able to compact.

fn set_physical_compaction(&mut self, frontier: AntichainRef<'_, Tr::Time>)[src]

Allows the trace to compact batches of times before frontier.

fn cursor_through(
    &mut self,
    frontier: AntichainRef<'_, Tr::Time>
) -> Option<(Tr::Cursor, <Tr::Cursor as Cursor<Tr::Key, Tr::Val, Tr::Time, Tr::R>>::Storage)>
[src]

Creates a new cursor over the wrapped trace.

impl<Tr, F> TraceReader for TraceFilter<Tr, F> where
    Tr: TraceReader,
    Tr::Batch: Clone,
    Tr::Key: 'static,
    Tr::Val: 'static,
    Tr::Time: Timestamp,
    Tr::R: 'static,
    F: FnMut(&Tr::Key, &Tr::Val) -> bool + Clone + 'static, 
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = Tr::Time

type R = Tr::R

type Batch = BatchFilter<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Batch, F>

type Cursor = CursorFilter<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Cursor, F>

impl<Tr, F> TraceReader for TraceFreeze<Tr, F> where
    Tr: TraceReader,
    Tr::Batch: Clone,
    Tr::Key: 'static,
    Tr::Val: 'static,
    Tr::Time: Lattice + Clone + 'static,
    Tr::R: 'static,
    F: Fn(&Tr::Time) -> Option<Tr::Time> + 'static, 
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = Tr::Time

type R = Tr::R

type Batch = BatchFreeze<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Batch, F>

type Cursor = CursorFreeze<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Cursor, F>

impl<Tr, TInner> TraceReader for differential_dataflow::trace::wrappers::enter::TraceEnter<Tr, TInner> where
    Tr: TraceReader,
    Tr::Batch: Clone,
    Tr::Key: 'static,
    Tr::Val: 'static,
    Tr::Time: Timestamp,
    Tr::R: 'static,
    TInner: Refines<Tr::Time> + Lattice
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = TInner

type R = Tr::R

type Batch = BatchEnter<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Batch, TInner>

type Cursor = CursorEnter<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Cursor, TInner>

impl<Tr, TInner, F, G> TraceReader for differential_dataflow::trace::wrappers::enter_at::TraceEnter<Tr, TInner, F, G> where
    Tr: TraceReader,
    Tr::Batch: Clone,
    Tr::Key: 'static,
    Tr::Val: 'static,
    Tr::Time: Timestamp,
    TInner: Refines<Tr::Time> + Lattice,
    Tr::R: 'static,
    F: 'static,
    F: FnMut(&Tr::Key, &Tr::Val, &Tr::Time) -> TInner + Clone,
    G: FnMut(&TInner) -> Tr::Time + Clone + 'static, 
[src]

type Key = Tr::Key

type Val = Tr::Val

type Time = TInner

type R = Tr::R

type Batch = BatchEnter<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Batch, TInner, F>

type Cursor = CursorEnter<Tr::Key, Tr::Val, Tr::Time, Tr::R, Tr::Cursor, TInner, F>

Loading content...