Struct Domain

Source
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>
where T: Timestamp + Lattice + Rewind,

Source

pub fn new(start_at: T) -> Self

Creates a new domain.

Source

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.

Source

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.

Source

pub fn register_arrangement( &mut self, name: String, config: RelationConfig, trace: RelationHandle<T>, )

Inserts a new named relation.

Source

pub fn transact(&mut self, tx_data: Vec<TxData>) -> Result<(), Error>

Transact data into one or more inputs.

Source

pub fn close_input(&mut self, name: String) -> Result<(), Error>

Closes and drops an existing input.

Source

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.

Source

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.

Source

pub fn advance_traces(&mut self, frontier: &[T]) -> Result<(), Error>

Advances domain traces up to the specified frontier minus their configured slack.

Source

pub fn domain_probe(&self) -> &ProbeHandle<T>

Returns a handle to the domain’s input probe.

Source

pub fn epoch(&self) -> &T

Reports the current input epoch.

Source

pub fn probed_source_count(&self) -> usize

Reports the number of probed (timeful) sources in the domain.

Source

pub fn dominates(&self, frontier: AntichainRef<'_, T>) -> bool

Returns true iff the frontier dominates all domain inputs.

Auto Trait Implementations§

§

impl<T> Freeze for Domain<T>
where T: Freeze,

§

impl<T> !RefUnwindSafe for Domain<T>

§

impl<T> !Send for Domain<T>

§

impl<T> !Sync for Domain<T>

§

impl<T> Unpin for Domain<T>
where T: Unpin,

§

impl<T> !UnwindSafe for Domain<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.