Struct dataflow::source::timestamp::TimestampBindingUpdater [−][src]
pub struct TimestampBindingUpdater {
current_bindings_frontier: Antichain<Timestamp>,
current_bindings: ChangeBatch<(SourceTimestamp, AssignedTimestamp)>,
}
Expand description
Helper that can track the timestamp bindings from a TimestampBindingRc
and emit
differential updates that can be used to reconstruct the timestamp bindings.
This can be used to tee off a “stream” of differential updates that can be used to maintain a copy of the current state of the bindings. For example, to persist them.
Fields
current_bindings_frontier: Antichain<Timestamp>
Current upper frontier of timestamp bindings, to avoid allocating a new Antichain
on
every invocation.
current_bindings: ChangeBatch<(SourceTimestamp, AssignedTimestamp)>
Consolidated view of the changes that we have emitted up to the latest invocation of
update
.
Implementations
Creates a new TimestampBindingUpdater
. We need the initial_bindings
to bootstrap the
internal view with the current state of the bindings that the outside consumer of the
updates has.
Note: You will usually not want to bootstrap this from a TimestampBindingsRc
but instead
from bindings that were restored from persistence. The reason is that the bindings in the
TimestampBindingsRc
can come from other sources and we must ensure that our internal view
matches the state we have in persistence.
pub fn update(
&mut self,
timestamp_histories: &TimestampBindingRc
) -> impl Iterator<Item = ((SourceTimestamp, AssignedTimestamp), i64)>
pub fn update(
&mut self,
timestamp_histories: &TimestampBindingRc
) -> impl Iterator<Item = ((SourceTimestamp, AssignedTimestamp), i64)>
Brings the internal view of the bindings up to date with the bindings in the given
timestamp_histories
and returns any changes as differential updates.
Auto Trait Implementations
impl RefUnwindSafe for TimestampBindingUpdater
impl Send for TimestampBindingUpdater
impl Sync for TimestampBindingUpdater
impl Unpin for TimestampBindingUpdater
impl UnwindSafe for TimestampBindingUpdater
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more