pub struct Domain<T: Timestamp + Lattice> {
pub attributes: HashMap<Aid, AttributeConfig>,
pub forward_count: HashMap<Aid, TraceKeyHandle<Value, T, isize>>,
pub forward_propose: HashMap<Aid, TraceValHandle<Value, Value, T, isize>>,
pub forward_validate: HashMap<Aid, TraceKeyHandle<(Value, Value), T, isize>>,
pub reverse_count: HashMap<Aid, TraceKeyHandle<Value, T, isize>>,
pub reverse_propose: HashMap<Aid, TraceValHandle<Value, Value, T, isize>>,
pub reverse_validate: HashMap<Aid, TraceKeyHandle<(Value, Value), T, isize>>,
pub relations: HashMap<Aid, RelationConfig>,
pub arrangements: HashMap<Aid, RelationHandle<T>>,
/* private fields */
}
Expand description
A domain manages attributes that share a timestamp semantics. Each attribute within a domain can be either fed from an external system, or from user transactions. The former are referred to as sourced, the latter as transactable attributes.
Both types of input must make sure not to block overall domain progress, s.t. results can be revealed and traces can be compacted. For attributes with an opinion on time, users and source operators are required to regularly downgrade their capabilities. As they do so, the domain frontier advances.
Some attributes do not care about time. Such attributes want their information to be immediately available to all queries. Conceptually, they want all their inputs to happen at t0. This is however not a practical solution, because holding capabilities for t0 in perpetuity completely stalls monotemporal domains and prevents trace compaction in multitemporal ones. We refer to this type of attributes as timeless. Instead, timeless attributes must be automatically advanced in lockstep with a high-watermark of all timeful domain inputs. This ensures that they will never block overall progress.
Fields§
§attributes: HashMap<Aid, AttributeConfig>
Configurations for attributes in this domain.
forward_count: HashMap<Aid, TraceKeyHandle<Value, T, isize>>
Forward count traces.
forward_propose: HashMap<Aid, TraceValHandle<Value, Value, T, isize>>
Forward propose traces.
forward_validate: HashMap<Aid, TraceKeyHandle<(Value, Value), T, isize>>
Forward validate traces.
reverse_count: HashMap<Aid, TraceKeyHandle<Value, T, isize>>
Reverse count traces.
reverse_propose: HashMap<Aid, TraceValHandle<Value, Value, T, isize>>
Reverse propose traces.
reverse_validate: HashMap<Aid, TraceKeyHandle<(Value, Value), T, isize>>
Reverse validate traces.
relations: HashMap<Aid, RelationConfig>
Configuration for relations in this domain.
arrangements: HashMap<Aid, RelationHandle<T>>
Relation traces.
Implementations§
Source§impl<T> Domain<T>
impl<T> Domain<T>
Sourcepub fn create_transactable_attribute<S: Scope<Timestamp = T>>(
&mut self,
name: &str,
config: AttributeConfig,
scope: &mut S,
) -> Result<(), Error>
pub fn create_transactable_attribute<S: Scope<Timestamp = T>>( &mut self, name: &str, config: AttributeConfig, scope: &mut S, ) -> Result<(), Error>
Creates an attribute that can be transacted upon by clients.
Sourcepub fn create_sourced_attribute<S: Scope + ScopeParent<Timestamp = T>>(
&mut self,
name: &str,
config: AttributeConfig,
pairs: &Stream<S, ((Value, Value), T, isize)>,
) -> Result<(), Error>
pub fn create_sourced_attribute<S: Scope + ScopeParent<Timestamp = T>>( &mut self, name: &str, config: AttributeConfig, pairs: &Stream<S, ((Value, Value), T, isize)>, ) -> Result<(), Error>
Creates an attribute that is controlled by a source and thus can not be transacted upon by clients.
Sourcepub fn register_arrangement(
&mut self,
name: String,
config: RelationConfig,
trace: RelationHandle<T>,
)
pub fn register_arrangement( &mut self, name: String, config: RelationConfig, trace: RelationHandle<T>, )
Inserts a new named relation.
Sourcepub fn transact(&mut self, tx_data: Vec<TxData>) -> Result<(), Error>
pub fn transact(&mut self, tx_data: Vec<TxData>) -> Result<(), Error>
Transact data into one or more inputs.
Sourcepub fn close_input(&mut self, name: String) -> Result<(), Error>
pub fn close_input(&mut self, name: String) -> Result<(), Error>
Closes and drops an existing input.
Sourcepub fn advance(&mut self) -> Result<(), Error>
pub fn advance(&mut self) -> Result<(), Error>
Advances the domain to the current domain frontier, thus allowing traces to compact. All domain input handles are forwarded up to the frontier, so as not to stall progress.
Sourcepub fn advance_epoch(&mut self, next: T) -> Result<(), Error>
pub fn advance_epoch(&mut self, next: T) -> Result<(), Error>
Advances the domain epoch. The domain epoch can be in advance of or lag behind the domain frontier. It is used by timeless attributes to avoid stalling timeful inputs.
Sourcepub fn advance_traces(&mut self, frontier: &[T]) -> Result<(), Error>
pub fn advance_traces(&mut self, frontier: &[T]) -> Result<(), Error>
Advances domain traces up to the specified frontier minus their configured slack.
Sourcepub fn domain_probe(&self) -> &ProbeHandle<T>
pub fn domain_probe(&self) -> &ProbeHandle<T>
Returns a handle to the domain’s input probe.
Sourcepub fn probed_source_count(&self) -> usize
pub fn probed_source_count(&self) -> usize
Reports the number of probed (timeful) sources in the domain.
Sourcepub fn dominates(&self, frontier: AntichainRef<'_, T>) -> bool
pub fn dominates(&self, frontier: AntichainRef<'_, T>) -> bool
Returns true iff the frontier dominates all domain inputs.