Trait differential_dataflow::trace::Trace
source · pub trait Trace: TraceReader{
type Batcher: Batcher<Time = Self::Time>;
type Builder: Builder<Input = <Self::Batcher as Batcher>::Output, Time = Self::Time, Output = Self::Batch>;
// Required methods
fn new(
info: OperatorInfo,
logging: Option<Logger>,
activator: Option<Activator>,
) -> Self;
fn exert(&mut self);
fn set_exert_logic(&mut self, logic: ExertionLogic);
fn insert(&mut self, batch: Self::Batch);
fn close(&mut self);
}
Expand description
An append-only collection of (key, val, time, diff)
tuples.
The trace must pretend to look like a collection of (Key, Val, Time, isize)
tuples, but is permitted
to introduce new types KeyRef
, ValRef
, and TimeRef
which can be dereference to the types above.
The trace must be constructable from, and navigable by the Key
, Val
, Time
types, but does not need
to return them.
Required Associated Types§
Required Methods§
sourcefn new(
info: OperatorInfo,
logging: Option<Logger>,
activator: Option<Activator>,
) -> Self
fn new( info: OperatorInfo, logging: Option<Logger>, activator: Option<Activator>, ) -> Self
Allocates a new empty trace.
sourcefn set_exert_logic(&mut self, logic: ExertionLogic)
fn set_exert_logic(&mut self, logic: ExertionLogic)
Sets the logic for exertion in the absence of updates.
The function receives an iterator over batch levels, from large to small, as triples (level, count, length)
,
indicating the level, the number of batches, and their total length in updates. It should return a number of
updates to perform, or None
if no work is required.
sourcefn insert(&mut self, batch: Self::Batch)
fn insert(&mut self, batch: Self::Batch)
Introduces a batch of updates to the trace.
Batches describe the time intervals they contain, and they should be added to the trace in contiguous intervals. If a batch arrives with a lower bound that does not equal the upper bound of the most recent addition, the trace will add an empty batch. It is an error to then try to populate that region of time.
This restriction could be relaxed, especially if we discover ways in which batch interval order could commute. For now, the trace should complain, to the extent that it cares about contiguous intervals.