pub trait ReduceTactic<T, B1, B2> {
// Required method
fn retire(
&mut self,
source_batches: Vec<B1>,
output_batches: Vec<B2>,
input_batches: Vec<B1>,
lower: &Antichain<T>,
upper: &Antichain<T>,
held: &Antichain<T>,
) -> (Option<Span<T, B2>>, Antichain<T>);
}Expand description
A type that resolves a key-wise reduction over batches arriving on the input.
Unlike join, reduce does not suspend: its output is at most linear in its input, so a single
retire runs the whole [lower, upper) interval to completion rather than yielding under a fuel
budget.
Required Methods§
Sourcefn retire(
&mut self,
source_batches: Vec<B1>,
output_batches: Vec<B2>,
input_batches: Vec<B1>,
lower: &Antichain<T>,
upper: &Antichain<T>,
held: &Antichain<T>,
) -> (Option<Span<T, B2>>, Antichain<T>)
fn retire( &mut self, source_batches: Vec<B1>, output_batches: Vec<B2>, input_batches: Vec<B1>, lower: &Antichain<T>, upper: &Antichain<T>, held: &Antichain<T>, ) -> (Option<Span<T, B2>>, Antichain<T>)
Retire the interval [lower, upper), producing the output batch it informs.
It is presented with the pre-existing input batches and output batches (those before lower),
the new input batches, and held: the times the operator currently holds capabilities for. It
reasons only about times, returning the output batch to ship — None when the interval holds
no work at all — and the new frontier of interesting times for the operator to hold.
§Contract
The driver (reduce_with_tactic) relies on the following; the first is cheap to check
and is debug_assert!ed there.
- Spanning output. The returned batch’s description is exactly
[lower, upper). The driver ships it stamped with the held times not in advance ofupper, which justify its contents: every update time lies at or beyond one of them (a time at or beyond only the remaining held times would be in advance ofupper, and so outside the interval). - Frontier bounds withheld work, and collapses to empty when there is none. The returned frontier must be at-or-below every time the tactic defers, so the driver knows what is safe to release. In particular, with no work to defer it must be the empty antichain. Derive it from the actual withheld set rather than constructing it and this holds for free; returning a non-empty frontier with nothing pending holds capabilities forever and deadlocks recursive scopes. (Not driver-checkable — the withheld set is tactic-internal — so tactics self-enforce.)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".