Skip to main content

Trace

Trait Trace 

Source
pub trait Trace: TraceReader {
    // 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, span: Span<Self::Time, Self::Batch>);
    fn close(&mut self);
}
Expand description

An append-only collection of (key, val, time, diff) tuples.

The trace itself is opinionated only about Time, which bounds its contents and drives its compaction. Key, value, and diff opinions live on the batches, which the trace does not constrain.

Required Methods§

Source

fn new( info: OperatorInfo, logging: Option<Logger>, activator: Option<Activator>, ) -> Self

Allocates a new empty trace.

Source

fn exert(&mut self)

Exert merge effort, even without updates.

Source

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.

Source

fn insert(&mut self, span: Span<Self::Time, Self::Batch>)

Introduces a span of updates to the trace.

Spans describe the time intervals they contain, and they should be added to the trace in contiguous intervals. If a span arrives with a lower bound that does not equal the upper bound of the most recent addition, the trace will add a span with no updates. 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 span interval order could commute. For now, the trace should complain, to the extent that it cares about contiguous intervals.

Source

fn close(&mut self)

Introduces an update-free span concluding the trace.

This method should be logically equivalent to introducing a span with no updates whose lower frontier equals the upper frontier of the most recently introduced span, and whose upper frontier is empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<B: SpineBatch + Clone + 'static> Trace for Spine<B>