[][src]Struct declarative_dataflow::domain::Domain

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>>,
    // some fields omitted
}

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.

Methods

impl<T> Domain<T> where
    T: Timestamp + Lattice + Rewind
[src]

pub fn new(start_at: T) -> Self[src]

Creates a new domain.

pub fn create_transactable_attribute<S: Scope<Timestamp = T>>(
    &mut self,
    name: &str,
    config: AttributeConfig,
    scope: &mut S
) -> Result<(), Error>
[src]

Creates an attribute that can be transacted upon by clients.

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>
[src]

Creates an attribute that is controlled by a source and thus can not be transacted upon by clients.

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

Inserts a new named relation.

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

Transact data into one or more inputs.

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

Closes and drops an existing input.

pub fn advance(&mut self) -> Result<(), Error>[src]

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.

pub fn advance_epoch(&mut self, next: T) -> Result<(), Error>[src]

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.

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

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

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

Returns a handle to the domain's input probe.

pub fn epoch(&self) -> &T[src]

Reports the current input epoch.

pub fn probed_source_count(&self) -> usize[src]

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

pub fn dominates(&self, frontier: AntichainRef<T>) -> bool[src]

Returns true iff the frontier dominates all domain inputs.

Auto Trait Implementations

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

impl<T> !Sync for Domain<T>

impl<T> !Send for Domain<T>

impl<T> !RefUnwindSafe for Domain<T>

impl<T> !UnwindSafe for Domain<T>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]