pub struct Z1<T> { /* private fields */ }Expand description
z^-1 operator delays its input by one timestamp.
The operator outputs a user-defined “zero” value in the first timestamp after clock_start. For all subsequent timestamps, it outputs the value received as input at the previous timestamp. The zero value is typically the neutral element of a monoid (e.g., 0 for addition or 1 for multiplication).
It is a strict operator.
§Examples
time | input | output
---------------------
0 | 5 | 0
1 | 6 | 5
2 | 7 | 6
3 | 8 | 7
...Implementations§
Trait Implementations§
Source§impl<T> Operator for Z1<T>
impl<T> Operator for Z1<T>
Source§fn clock_start(&mut self, _scope: Scope)
fn clock_start(&mut self, _scope: Scope)
Notify the operator about the start of a new clock epoch. Read more
fn clock_end(&mut self, _scope: Scope)
Source§fn init(&mut self, global_id: &GlobalNodeId)
fn init(&mut self, global_id: &GlobalNodeId)
Initialize the operator
Source§fn metadata(&self, meta: &mut OperatorMeta)
fn metadata(&self, meta: &mut OperatorMeta)
Collects metadata about the current operator
Source§fn fixedpoint(&self, scope: Scope) -> bool
fn fixedpoint(&self, scope: Scope) -> bool
Check if the operator is in a stable state. Read more
Source§fn checkpoint(
&mut self,
base: &StoragePath,
persistent_id: Option<&str>,
files: &mut Vec<Arc<dyn FileCommitter>>,
) -> Result<(), Error>
fn checkpoint( &mut self, base: &StoragePath, persistent_id: Option<&str>, files: &mut Vec<Arc<dyn FileCommitter>>, ) -> Result<(), Error>
Instructs the operator to checkpoint its state to persistent storage in
directory
base. Any files that the operator creates should have
persistent_id in their names to keep them unique. Read moreSource§fn restore(
&mut self,
base: &StoragePath,
persistent_id: Option<&str>,
) -> Result<(), Error>
fn restore( &mut self, base: &StoragePath, persistent_id: Option<&str>, ) -> Result<(), Error>
Instruct the operator to restore its state from persistent storage in
directory
base, using persistent_id to find its files. Read moreSource§fn location(&self) -> OperatorLocation
fn location(&self) -> OperatorLocation
The location the operator was created at
Source§fn register_ready_callback<F>(&mut self, _cb: F)
fn register_ready_callback<F>(&mut self, _cb: F)
Register callback to be invoked when an asynchronous operator becomes
ready. Read more
Source§fn start_replay(&mut self) -> Result<(), Error>
fn start_replay(&mut self) -> Result<(), Error>
Start replaying the operator’s state to the replay stream. Read more
Source§fn is_replay_complete(&self) -> bool
fn is_replay_complete(&self) -> bool
Check if the operator has finished replaying its state. Read more
Source§fn end_replay(&mut self) -> Result<(), Error>
fn end_replay(&mut self) -> Result<(), Error>
Cleanup any state needed for replay and prepare the operator for normal operation. Read more
Source§fn start_transaction(&mut self)
fn start_transaction(&mut self)
Notify the operator about start of a transaction. Read more
Source§fn flush(&mut self)
fn flush(&mut self)
Notifies the operator that all of its predecessors have produced
all outputs for the current transaction. Read more
Source§fn is_flush_complete(&self) -> bool
fn is_flush_complete(&self) -> bool
Invoked after
flush after each eval call to check if all outputs
have been produced. Because it is invoked only after calling eval,
every operator must produce at least one output. Read moreSource§fn flush_progress(&self) -> Option<Position>
fn flush_progress(&self) -> Option<Position>
Returns the current progress of the operator in processing the current transaction. Read more
Source§fn start_compaction(&mut self)
fn start_compaction(&mut self)
Start compaction of the operator’s state. Read more
Source§impl<T> StrictOperator<T> for Z1<T>
impl<T> StrictOperator<T> for Z1<T>
Source§fn get_output(&mut self) -> T
fn get_output(&mut self) -> T
Returns the output value computed based on data consumed by the operator
during previous timestamps. This method is invoked before
eval_strict() has been invoked for the current timestamp. It can
be invoked at most once for each timestamp,
as the implementation may mutate or destroy the operator’s internal
state (for example Z1 returns its inner
value, leaving the operator empty).fn get_final_output(&mut self) -> T
Source§impl<T> StrictUnaryOperator<T, T> for Z1<T>
impl<T> StrictUnaryOperator<T, T> for Z1<T>
Source§fn flush_input(&mut self)
fn flush_input(&mut self)
Flush the input half of the strict operator. Read more
Source§fn is_flush_input_complete(&self) -> bool
fn is_flush_input_complete(&self) -> bool
See
StrictUnaryOperator::flush_input for more details.Source§async fn eval_strict(&mut self, i: &T)
async fn eval_strict(&mut self, i: &T)
Feed input for the current timestamp to the operator by reference. The
output will be consumed via
get_output during the
next timestamp.Source§async fn eval_strict_owned(&mut self, i: T)
async fn eval_strict_owned(&mut self, i: T)
Feed input for the current timestamp to the operator by value. The
output will be consumed via
get_output during the
next timestamp.Source§fn input_preference(&self) -> OwnershipPreference
fn input_preference(&self) -> OwnershipPreference
Ownership preference on the operator’s input stream
(see
OwnershipPreference).Source§impl<T> UnaryOperator<T, T> for Z1<T>
impl<T> UnaryOperator<T, T> for Z1<T>
Source§async fn eval_owned(&mut self, i: T) -> T
async fn eval_owned(&mut self, i: T) -> T
Consume input by value.
Source§fn input_preference(&self) -> OwnershipPreference
fn input_preference(&self) -> OwnershipPreference
Ownership preference on the operator’s input stream
(see
OwnershipPreference).Auto Trait Implementations§
impl<T> Freeze for Z1<T>where
T: Freeze,
impl<T> RefUnwindSafe for Z1<T>where
T: RefUnwindSafe,
impl<T> Send for Z1<T>where
T: Send,
impl<T> Sync for Z1<T>where
T: Sync,
impl<T> Unpin for Z1<T>where
T: Unpin,
impl<T> UnsafeUnpin for Z1<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Z1<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.