pub type DataflowDesc = DataflowDescription<OptimizedMirRelationExpr, ()>;
Expand description
A commonly used name for dataflows contain MIR expressions.
Aliased Type§
struct DataflowDesc {
pub source_imports: BTreeMap<GlobalId, (SourceInstanceDesc<()>, bool)>,
pub index_imports: BTreeMap<GlobalId, IndexImport>,
pub objects_to_build: Vec<BuildDesc<OptimizedMirRelationExpr>>,
pub index_exports: BTreeMap<GlobalId, (IndexDesc, RelationType)>,
pub sink_exports: BTreeMap<GlobalId, ComputeSinkDesc>,
pub as_of: Option<Antichain<Timestamp>>,
pub until: Antichain<Timestamp>,
pub initial_storage_as_of: Option<Antichain<Timestamp>>,
pub refresh_schedule: Option<RefreshSchedule>,
pub debug_name: String,
pub time_dependence: Option<TimeDependence>,
}
Fields§
§source_imports: BTreeMap<GlobalId, (SourceInstanceDesc<()>, bool)>
Sources instantiations made available to the dataflow pair with monotonicity information.
index_imports: BTreeMap<GlobalId, IndexImport>
Indexes made available to the dataflow. (id of index, import)
objects_to_build: Vec<BuildDesc<OptimizedMirRelationExpr>>
Views and indexes to be built and stored in the local context. Objects must be built in the specific order, as there may be dependencies of later objects on prior identifiers.
index_exports: BTreeMap<GlobalId, (IndexDesc, RelationType)>
Indexes to be made available to be shared with other dataflows (id of new index, description of index, relationtype of base source/view/table)
sink_exports: BTreeMap<GlobalId, ComputeSinkDesc>
sinks to be created (id of new sink, description of sink)
as_of: Option<Antichain<Timestamp>>
An optional frontier to which inputs should be advanced.
If this is set, it should override the default setting determined by
the upper bound of since
frontiers contributing to the dataflow.
It is an error for this to be set to a frontier not beyond that default.
until: Antichain<Timestamp>
Frontier beyond which the dataflow should not execute.
Specifically, updates at times greater or equal to this frontier are suppressed.
This is often set to as_of + 1
to enable “batch” computations.
Note that frontier advancements might still happen to times that are after the until
,
only data is suppressed. (This is consistent with how frontier advancements can also
happen before the as_of
.)
initial_storage_as_of: Option<Antichain<Timestamp>>
The initial as_of when the collection is first created. Filled only for materialized views. Note that this doesn’t change upon restarts.
refresh_schedule: Option<RefreshSchedule>
The schedule of REFRESH materialized views.
debug_name: String
Human-readable name
time_dependence: Option<TimeDependence>
Description of how the dataflow’s progress relates to wall-clock time. None for unknown.
Implementations
Source§impl<T> DataflowDescription<OptimizedMirRelationExpr, (), T>
impl<T> DataflowDescription<OptimizedMirRelationExpr, (), T>
Sourcepub fn new(name: String) -> Self
pub fn new(name: String) -> Self
Creates a new dataflow description with a human-readable name.
Sourcepub fn import_index(
&mut self,
id: GlobalId,
desc: IndexDesc,
typ: RelationType,
monotonic: bool,
)
pub fn import_index( &mut self, id: GlobalId, desc: IndexDesc, typ: RelationType, monotonic: bool, )
Imports a previously exported index.
This method makes available an index previously exported as id
, identified
to the query by description
(which names the view the index arranges, and
the keys by which it is arranged).
Sourcepub fn import_source(
&mut self,
id: GlobalId,
typ: RelationType,
monotonic: bool,
)
pub fn import_source( &mut self, id: GlobalId, typ: RelationType, monotonic: bool, )
Imports a source and makes it available as id
.
Sourcepub fn insert_plan(&mut self, id: GlobalId, plan: OptimizedMirRelationExpr)
pub fn insert_plan(&mut self, id: GlobalId, plan: OptimizedMirRelationExpr)
Binds to id
the relation expression plan
.
Sourcepub fn export_index(
&mut self,
id: GlobalId,
description: IndexDesc,
on_type: RelationType,
)
pub fn export_index( &mut self, id: GlobalId, description: IndexDesc, on_type: RelationType, )
Exports as id
an index described by description
.
Future uses of import_index
in other dataflow descriptions may use id
,
as long as this dataflow has not been terminated in the meantime.
Sourcepub fn export_sink(&mut self, id: GlobalId, description: ComputeSinkDesc<(), T>)
pub fn export_sink(&mut self, id: GlobalId, description: ComputeSinkDesc<(), T>)
Exports as id
a sink described by description
.
Sourcepub fn is_imported(&self, id: &GlobalId) -> bool
pub fn is_imported(&self, id: &GlobalId) -> bool
Returns true iff id
is already imported.
Sourcepub fn arity_of(&self, id: &GlobalId) -> usize
pub fn arity_of(&self, id: &GlobalId) -> usize
The number of columns associated with an identifier in the dataflow.
Sourcepub fn visit_children<R, S, E>(&mut self, r: R, s: S) -> Result<(), E>where
R: Fn(&mut OptimizedMirRelationExpr) -> Result<(), E>,
S: Fn(&mut MirScalarExpr) -> Result<(), E>,
pub fn visit_children<R, S, E>(&mut self, r: R, s: S) -> Result<(), E>where
R: Fn(&mut OptimizedMirRelationExpr) -> Result<(), E>,
S: Fn(&mut MirScalarExpr) -> Result<(), E>,
Calls r and s on any sub-members of those types in self. Halts at the first error return.
Source§impl<P, S> DataflowDescription<P, S, Timestamp>
impl<P, S> DataflowDescription<P, S, Timestamp>
Sourcepub fn is_single_time(&self) -> bool
pub fn is_single_time(&self) -> bool
Tests if the dataflow refers to a single timestamp, namely
that as_of
has a single coordinate and that the until
value corresponds to the as_of
value plus one, or as_of
is the maximum timestamp and is thus single.
Source§impl<P, S, T> DataflowDescription<P, S, T>
impl<P, S, T> DataflowDescription<P, S, T>
Sourcepub fn set_as_of(&mut self, as_of: Antichain<T>)
pub fn set_as_of(&mut self, as_of: Antichain<T>)
Sets the as_of
frontier to the supplied argument.
This method allows the dataflow to indicate a frontier up through which all times should be advanced. This can be done for at least two reasons: 1. correctness and 2. performance.
Correctness may require an as_of
to ensure that historical detail
is consolidated at representative times that do not present specific
detail that is not specifically correct. For example, updates may be
compacted to times that are no longer the source times, but instead
some byproduct of when compaction was executed; we should not present
those specific times as meaningfully different from other equivalent
times.
Performance may benefit from an aggressive as_of
as it reduces the
number of distinct moments at which collections vary. Differential
dataflow will refresh its outputs at each time its inputs change and
to moderate that we can minimize the volume of distinct input times
as much as possible.
Generally, one should consider setting as_of
at least to the since
frontiers of contributing data sources and as aggressively as the
computation permits.
Sourcepub fn set_initial_as_of(&mut self, initial_as_of: Antichain<T>)
pub fn set_initial_as_of(&mut self, initial_as_of: Antichain<T>)
Records the initial as_of
of the storage collection associated with a materialized view.
Sourcepub fn import_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
pub fn import_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
Identifiers of imported objects (indexes and sources).
Sourcepub fn imported_index_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
pub fn imported_index_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
Identifiers of imported indexes.
Sourcepub fn imported_source_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
pub fn imported_source_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
Identifiers of imported sources.
Sourcepub fn export_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
pub fn export_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
Identifiers of exported objects (indexes and sinks).
Sourcepub fn exported_index_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
pub fn exported_index_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
Identifiers of exported indexes.
Sourcepub fn exported_sink_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
pub fn exported_sink_ids(&self) -> impl Iterator<Item = GlobalId> + Clone + '_
Identifiers of exported sinks.
Sourcepub fn persist_sink_ids(&self) -> impl Iterator<Item = GlobalId> + '_
pub fn persist_sink_ids(&self) -> impl Iterator<Item = GlobalId> + '_
Identifiers of exported persist sinks.
Sourcepub fn subscribe_ids(&self) -> impl Iterator<Item = GlobalId> + '_
pub fn subscribe_ids(&self) -> impl Iterator<Item = GlobalId> + '_
Identifiers of exported subscribe sinks.
Sourcepub fn continual_task_ids(&self) -> impl Iterator<Item = GlobalId> + '_
pub fn continual_task_ids(&self) -> impl Iterator<Item = GlobalId> + '_
Identifiers of exported continual tasks.
Sourcepub fn copy_to_ids(&self) -> impl Iterator<Item = GlobalId> + '_
pub fn copy_to_ids(&self) -> impl Iterator<Item = GlobalId> + '_
Identifiers of exported copy to sinks.
Sourcepub fn display_import_ids(&self) -> impl Display + '_
pub fn display_import_ids(&self) -> impl Display + '_
Produce a Display
able value containing the import IDs of this dataflow.
Sourcepub fn display_export_ids(&self) -> impl Display + '_
pub fn display_export_ids(&self) -> impl Display + '_
Produce a Display
able value containing the export IDs of this dataflow.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Whether this dataflow installs transient collections.
Sourcepub fn build_desc(&self, id: GlobalId) -> &BuildDesc<P>
pub fn build_desc(&self, id: GlobalId) -> &BuildDesc<P>
Returns the description of the object to build with the specified identifier.
§Panics
Panics if id
is not present in objects_to_build
exactly once.
Source§impl<P, S, T> DataflowDescription<P, S, T>where
P: CollectionPlan,
impl<P, S, T> DataflowDescription<P, S, T>where
P: CollectionPlan,
Sourcepub fn depends_on(&self, collection_id: GlobalId) -> BTreeSet<GlobalId>
pub fn depends_on(&self, collection_id: GlobalId) -> BTreeSet<GlobalId>
Computes the set of identifiers upon which the specified collection identifier depends.
collection_id
must specify a valid object in objects_to_build
.
This method includes identifiers for e.g. intermediate views, and should be filtered if one only wants sources and indexes.
This method is safe for mutually recursive view definitions.
Sourcepub fn depends_on_into(
&self,
collection_id: GlobalId,
out: &mut BTreeSet<GlobalId>,
)
pub fn depends_on_into( &self, collection_id: GlobalId, out: &mut BTreeSet<GlobalId>, )
Like depends_on
, but appends to an existing BTreeSet
.
Sourcepub fn depends_on_imports(&self, collection_id: GlobalId) -> BTreeSet<GlobalId>
pub fn depends_on_imports(&self, collection_id: GlobalId) -> BTreeSet<GlobalId>
Computes the set of imports upon which the specified collection depends.
This method behaves like depends_on
but filters out internal dependencies that are not
included in the dataflow imports.
Trait Implementations
Source§impl Arbitrary for DataflowDescription<OptimizedMirRelationExpr, (), Timestamp>
impl Arbitrary for DataflowDescription<OptimizedMirRelationExpr, (), Timestamp>
Source§type Strategy = BoxedStrategy<DataflowDescription<OptimizedMirRelationExpr>>
type Strategy = BoxedStrategy<DataflowDescription<OptimizedMirRelationExpr>>
Strategy
used to generate values of type Self
.Source§type Parameters = ()
type Parameters = ()
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.Source§fn arbitrary_with(_: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_: Self::Parameters) -> Self::Strategy
Source§impl<P: Clone, S: Clone + 'static, T: Clone> Clone for DataflowDescription<P, S, T>
impl<P: Clone, S: Clone + 'static, T: Clone> Clone for DataflowDescription<P, S, T>
Source§fn clone(&self) -> DataflowDescription<P, S, T>
fn clone(&self) -> DataflowDescription<P, S, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de, P, S, T> Deserialize<'de> for DataflowDescription<P, S, T>
impl<'de, P, S, T> Deserialize<'de> for DataflowDescription<P, S, T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl<'a> Explain<'a> for DataflowDescription<OptimizedMirRelationExpr>
impl<'a> Explain<'a> for DataflowDescription<OptimizedMirRelationExpr>
Source§type Context = ExplainContext<'a>
type Context = ExplainContext<'a>
Source§type Text = ExplainMultiPlan<'a, MirRelationExpr>
type Text = ExplainMultiPlan<'a, MirRelationExpr>
Explain::explain_text
call.Source§type VerboseText = ExplainMultiPlan<'a, MirRelationExpr>
type VerboseText = ExplainMultiPlan<'a, MirRelationExpr>
Explain::explain_verbose_text
call.Source§type Json = ExplainMultiPlan<'a, MirRelationExpr>
type Json = ExplainMultiPlan<'a, MirRelationExpr>
Explain::explain_json
call.Source§type Dot = UnsupportedFormat
type Dot = UnsupportedFormat
Explain::explain_json
call.Source§fn explain_text(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::Text, ExplainError>
fn explain_text( &'a mut self, context: &'a Self::Context, ) -> Result<Self::Text, ExplainError>
Source§fn explain_verbose_text(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::VerboseText, ExplainError>
fn explain_verbose_text( &'a mut self, context: &'a Self::Context, ) -> Result<Self::VerboseText, ExplainError>
Result::Ok
of the Explain::VerboseText
format
from the config and the context. Read moreSource§fn explain_json(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::Text, ExplainError>
fn explain_json( &'a mut self, context: &'a Self::Context, ) -> Result<Self::Text, ExplainError>
Source§fn explain(
&'a mut self,
format: &'a ExplainFormat,
context: &'a Self::Context,
) -> Result<String, ExplainError>
fn explain( &'a mut self, format: &'a ExplainFormat, context: &'a Self::Context, ) -> Result<String, ExplainError>
Source§fn explain_dot(
&'a mut self,
context: &'a Self::Context,
) -> Result<Self::Dot, ExplainError>
fn explain_dot( &'a mut self, context: &'a Self::Context, ) -> Result<Self::Dot, ExplainError>
Source§impl<P: PartialEq, S: PartialEq + 'static, T: PartialEq> PartialEq for DataflowDescription<P, S, T>
impl<P: PartialEq, S: PartialEq + 'static, T: PartialEq> PartialEq for DataflowDescription<P, S, T>
Source§fn eq(&self, other: &DataflowDescription<P, S, T>) -> bool
fn eq(&self, other: &DataflowDescription<P, S, T>) -> bool
self
and other
values to be equal, and is used by ==
.