pub struct ProdDfirBuilder {
pub graphs: SecondaryMap<LocationKey, FlatGraphBuilder>,
/* private fields */
}Available on crate feature
build only.Expand description
The production (deployment) DFIR builder: emits one DFIR graph per root location (process/cluster).
Tick and atomic locations are collapsed onto their root location’s graph. In the future
(#2902), this builder will additionally emit each (unified) tick as a root-level
loop {{ ... }} context within its root location’s graph.
Fields§
§graphs: SecondaryMap<LocationKey, FlatGraphBuilder>The DFIR graph builder for each root location.
Trait Implementations§
Source§impl Default for ProdDfirBuilder
impl Default for ProdDfirBuilder
Source§impl DfirBuilder for ProdDfirBuilder
impl DfirBuilder for ProdDfirBuilder
Source§fn add_tick_source(
&mut self,
location: &LocationId,
source_rhs: TokenStream,
out_ident: &Ident,
kind: &CollectionKind,
replay_each_tick: bool,
operator_tag: Option<&str>,
)
fn add_tick_source( &mut self, location: &LocationId, source_rhs: TokenStream, out_ident: &Ident, kind: &CollectionKind, replay_each_tick: bool, operator_tag: Option<&str>, )
In production, DFIR sources must be at the root level, outside of the tick’s
loop { ... } context: it emits the source at the root and windows it into the loop.
Source§fn singleton_intermediates(&self) -> bool
fn singleton_intermediates(&self) -> bool
Whether the representation of singletons should include intermediate states.
Source§fn add_dfir_at(
&mut self,
location: &LocationId,
dfir: DfirCode,
operator_tag: Option<&str>,
)
fn add_dfir_at( &mut self, location: &LocationId, dfir: DfirCode, operator_tag: Option<&str>, )
Adds the DFIR statements to the graph for the given location. Read more
Source§fn batch(
&mut self,
in_ident: Ident,
in_location: &LocationId,
in_kind: &CollectionKind,
out_ident: &Ident,
out_location: &LocationId,
_op_meta: &HydroIrOpMetadata,
_fold_hooked_idents: &HashSet<String>,
)
fn batch( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, _op_meta: &HydroIrOpMetadata, _fold_hooked_idents: &HashSet<String>, )
Lowers a
HydroNode::Batch: windows a stream-like collection (in_kind must be a
stream, a keyed stream, or a keyed singleton with bounded per-key values) into the tick
at out_location, so that each firing observes just the elements that arrived since
the previous batch. Read moreSource§fn snapshot(
&mut self,
in_ident: Ident,
in_location: &LocationId,
in_kind: &CollectionKind,
out_ident: &Ident,
out_location: &LocationId,
_op_meta: &HydroIrOpMetadata,
_fold_hooked_idents: &HashSet<String>,
)
fn snapshot( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, _op_meta: &HydroIrOpMetadata, _fold_hooked_idents: &HashSet<String>, )
Lowers a
HydroNode::Snapshot: windows a singleton-like collection (in_kind must be
a singleton, an optional, or a keyed singleton whose per-key values may change) into the
tick at out_location, so that each firing observes the collection’s current value. Read morefn yield_from_tick( &mut self, in_ident: Ident, in_location: &LocationId, _in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, out_kind: &CollectionKind, )
Source§fn unwindow_for_consume(
&mut self,
in_ident: Ident,
in_location: &LocationId,
out_location: &LocationId,
) -> Ident
fn unwindow_for_consume( &mut self, in_ident: Ident, in_location: &LocationId, out_location: &LocationId, ) -> Ident
Un-windows an ident when it is produced inside a tick’s
loop { ... } context
(in_location) but is about to be consumed by an operator emitted at a location
(out_location) outside that loop. Returns the ident to use downstream. Read morefn begin_atomic( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_location: &LocationId, op_meta: &HydroIrOpMetadata, )
fn end_atomic( &mut self, in_ident: Ident, in_location: &LocationId, in_kind: &CollectionKind, out_ident: &Ident, out_kind: &CollectionKind, )
fn observe_nondet( &mut self, _trusted: bool, location: &LocationId, in_ident: Ident, _in_kind: &CollectionKind, out_ident: &Ident, _out_kind: &CollectionKind, _op_meta: &HydroIrOpMetadata, )
fn merge_ordered( &mut self, location: &LocationId, first_ident: Ident, second_ident: Ident, out_ident: &Ident, _in_kind: &CollectionKind, _op_meta: &HydroIrOpMetadata, operator_tag: Option<&str>, )
fn create_network( &mut self, from: &LocationId, to: &LocationId, input_ident: Ident, out_ident: &Ident, serialize: Option<&DebugExpr>, sink: Expr, source: Expr, deserialize: Option<&DebugExpr>, _external_element_type: Option<&Type>, tag_id: StmtId, _networking_info: &NetworkingInfo, )
fn create_external_source( &mut self, on: &LocationId, source_expr: Expr, out_ident: &Ident, deserialize: Option<&DebugExpr>, tag_id: StmtId, )
fn create_external_output( &mut self, on: &LocationId, sink_expr: Expr, input_ident: &Ident, serialize: Option<&DebugExpr>, tag_id: StmtId, )
Source§fn emit_fold_hook(
&mut self,
_location: &LocationId,
_in_ident: &Ident,
_in_kind: &CollectionKind,
_op_meta: &HydroIrOpMetadata,
) -> Option<Ident>
fn emit_fold_hook( &mut self, _location: &LocationId, _in_ident: &Ident, _in_kind: &CollectionKind, _op_meta: &HydroIrOpMetadata, ) -> Option<Ident>
Optionally emit a fold hook that buffers and permutes inputs before the fold.
Returns the new input ident to use for the fold if a hook was emitted.
Source§fn assert_is_consistent(
&mut self,
_trusted: bool,
location: &LocationId,
in_ident: Ident,
out_ident: &Ident,
)
fn assert_is_consistent( &mut self, _trusted: bool, location: &LocationId, in_ident: Ident, out_ident: &Ident, )
Inserts necessary code to validate a manual assertion that at this point the
input live collection is consistent. In production, this is a no-op, but in simulation
this will (not yet implemented) inject assertions that validate consistency.
Source§fn observe_for_mut(
&mut self,
location: &LocationId,
in_ident: Ident,
_in_kind: &CollectionKind,
out_ident: &Ident,
_op_meta: &HydroIrOpMetadata,
)
fn observe_for_mut( &mut self, location: &LocationId, in_ident: Ident, _in_kind: &CollectionKind, out_ident: &Ident, _op_meta: &HydroIrOpMetadata, )
Observes non-determinism introduced by a mut closure operating on a non-strict
(unordered / at-least-once) input. In production this is identity; in simulation
it delegates to
observe_nondet with the strict output kind.fn create_versioned_network_fork( &mut self, _channel_id: u32, _dest: &LocationId, _senders: Vec<(LocationId, Ident, Option<DebugExpr>)>, _external_element_type: Option<&Type>, _tag_id: StmtId, )
fn create_versioned_network( &mut self, _channel_id: u32, _source: &LocationId, _dest: &LocationId, _out_ident: &Ident, _deserialize: Option<&DebugExpr>, _external_element_type: Option<&Type>, _tag_id: StmtId, )
Source§fn tick_state_lifetime(&self, _op_location: &LocationId) -> TokenStream
fn tick_state_lifetime(&self, _op_location: &LocationId) -> TokenStream
The DFIR persistence lifetime for operator state scoped to a single tick, for an operator
at
op_location. Read moreSource§fn cross_tick_state_lifetime(&self, _op_location: &LocationId) -> TokenStream
fn cross_tick_state_lifetime(&self, _op_location: &LocationId) -> TokenStream
The DFIR persistence lifetime for operator state that accumulates across ticks, for an
operator at
op_location. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ProdDfirBuilder
impl !Send for ProdDfirBuilder
impl !Sync for ProdDfirBuilder
impl !UnwindSafe for ProdDfirBuilder
impl Forget for ProdDfirBuilder
impl Freeze for ProdDfirBuilderwhere
*const u8 is !null: Freeze,
PhantomData<Slot<FlatGraphBuilder>>: Freeze,
PhantomData<fn(LocationKey) -> LocationKey>: Freeze,
PhantomData<(LocationId, GraphLoopId)>: Freeze,
impl Move for ProdDfirBuilder
impl Unpin for ProdDfirBuilderwhere
*const u8 is !null: Unpin,
NonZero<u32>: Unpin,
Rc<()>: Unpin,
Box<str>: Unpin,
Box<Type>: Unpin,
Rc<Vec<TokenTree>>: Unpin,
Box<Expr>: Unpin,
Box<Pat>: Unpin,
Box<LitRepr>: Unpin,
Box<LitIntRepr>: Unpin,
Box<LitFloatRepr>: Unpin,
Box<FieldPat>: Unpin,
Box<Path>: Unpin,
Box<Lifetime>: Unpin,
Box<CapturedParam>: Unpin,
Box<TypeParamBound>: Unpin,
Box<GenericParam>: Unpin,
Box<WherePredicate>: Unpin,
Box<Field>: Unpin,
Box<Variant>: Unpin,
Box<FnArg>: Unpin,
Box<Block>: Unpin,
Box<UseTree>: Unpin,
Box<FieldValue>: Unpin,
Box<BareFnArg>: Unpin,
Box<GenericArgument>: Unpin,
Box<PathSegment>: Unpin,
&'static OperatorConstraints: Unpin,
*const LeafNode<Ident, VarnameInfo> is !null: Unpin,
Box<(Ident, VarnameInfo)>: Unpin,
Box<LocationId>: Unpin,
impl UnsafeUnpin for ProdDfirBuilderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Slot<FlatGraphBuilder>>: UnsafeUnpin,
PhantomData<fn(LocationKey) -> LocationKey>: UnsafeUnpin,
PhantomData<(LocationId, GraphLoopId)>: UnsafeUnpin,
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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 moreCreates a shared type from an unshared type.