mz_adapter

Trait TimestampProvider

Source
pub trait TimestampProvider {
Show 13 methods // Required methods fn compute_read_frontier( &self, instance: ComputeInstanceId, id: GlobalId, ) -> Antichain<Timestamp>; fn compute_write_frontier( &self, instance: ComputeInstanceId, id: GlobalId, ) -> Antichain<Timestamp>; fn storage_frontiers( &self, ids: Vec<GlobalId>, ) -> Vec<(GlobalId, Antichain<Timestamp>, Antichain<Timestamp>)>; fn catalog_state(&self) -> &CatalogState; fn acquire_read_holds( &self, id_bundle: &CollectionIdBundle, ) -> ReadHolds<Timestamp>; // Provided methods fn get_timeline(timeline_context: &TimelineContext) -> Option<Timeline> { ... } fn needs_linearized_read_ts( isolation_level: &IsolationLevel, when: &QueryWhen, ) -> bool { ... } fn determine_timestamp_classical( &self, session: &Session, read_holds: &ReadHolds<Timestamp>, id_bundle: &CollectionIdBundle, when: &QueryWhen, oracle_read_ts: Option<Timestamp>, compute_instance: ComputeInstanceId, real_time_recency_ts: Option<Timestamp>, isolation_level: &IsolationLevel, timeline: &Option<Timeline>, largest_not_in_advance_of_upper: Timestamp, since: &Antichain<Timestamp>, ) -> Result<RawTimestampDetermination<Timestamp>, AdapterError> { ... } fn determine_timestamp_via_constraints( &self, session: &Session, read_holds: &ReadHolds<Timestamp>, id_bundle: &CollectionIdBundle, when: &QueryWhen, oracle_read_ts: Option<Timestamp>, compute_instance: ComputeInstanceId, real_time_recency_ts: Option<Timestamp>, isolation_level: &IsolationLevel, timeline: &Option<Timeline>, largest_not_in_advance_of_upper: Timestamp, ) -> Result<RawTimestampDetermination<Timestamp>, AdapterError> { ... } fn determine_timestamp_for( &self, session: &Session, id_bundle: &CollectionIdBundle, when: &QueryWhen, compute_instance: ComputeInstanceId, timeline_context: &TimelineContext, oracle_read_ts: Option<Timestamp>, real_time_recency_ts: Option<Timestamp>, isolation_level: &IsolationLevel, constraint_based: &ConstraintBasedTimestampSelection, ) -> Result<(TimestampDetermination<Timestamp>, ReadHolds<Timestamp>), AdapterError> { ... } fn least_valid_read( &self, read_holds: &ReadHolds<Timestamp>, ) -> Antichain<Timestamp> { ... } fn least_valid_write( &self, id_bundle: &CollectionIdBundle, ) -> Antichain<Timestamp> { ... } fn greatest_available_read( &self, id_bundle: &CollectionIdBundle, ) -> Antichain<Timestamp> { ... }
}

Required Methods§

Source

fn compute_read_frontier( &self, instance: ComputeInstanceId, id: GlobalId, ) -> Antichain<Timestamp>

Source

fn compute_write_frontier( &self, instance: ComputeInstanceId, id: GlobalId, ) -> Antichain<Timestamp>

Source

fn storage_frontiers( &self, ids: Vec<GlobalId>, ) -> Vec<(GlobalId, Antichain<Timestamp>, Antichain<Timestamp>)>

Returns the implied capability (since) and write frontier (upper) for the specified storage collections.

Source

fn catalog_state(&self) -> &CatalogState

Source

fn acquire_read_holds( &self, id_bundle: &CollectionIdBundle, ) -> ReadHolds<Timestamp>

Acquires ReadHolds, for the given id_bundle at the earliest possible times.

Provided Methods§

Source

fn get_timeline(timeline_context: &TimelineContext) -> Option<Timeline>

Source

fn needs_linearized_read_ts( isolation_level: &IsolationLevel, when: &QueryWhen, ) -> bool

Returns true if-and-only-if the given configuration needs a linearized read timetamp from a timestamp oracle.

This assumes that the query happens in the context of a timeline. If there is no timeline, we cannot and don’t have to get a linearized read timestamp.

Source

fn determine_timestamp_classical( &self, session: &Session, read_holds: &ReadHolds<Timestamp>, id_bundle: &CollectionIdBundle, when: &QueryWhen, oracle_read_ts: Option<Timestamp>, compute_instance: ComputeInstanceId, real_time_recency_ts: Option<Timestamp>, isolation_level: &IsolationLevel, timeline: &Option<Timeline>, largest_not_in_advance_of_upper: Timestamp, since: &Antichain<Timestamp>, ) -> Result<RawTimestampDetermination<Timestamp>, AdapterError>

Determines the timestamp for a query using the classical logic (as opposed to constraint-based).

Source

fn determine_timestamp_via_constraints( &self, session: &Session, read_holds: &ReadHolds<Timestamp>, id_bundle: &CollectionIdBundle, when: &QueryWhen, oracle_read_ts: Option<Timestamp>, compute_instance: ComputeInstanceId, real_time_recency_ts: Option<Timestamp>, isolation_level: &IsolationLevel, timeline: &Option<Timeline>, largest_not_in_advance_of_upper: Timestamp, ) -> Result<RawTimestampDetermination<Timestamp>, AdapterError>

Uses constraints and preferences to determine a timestamp for a query. Returns the determined timestamp, the constraints that were applied, and session_oracle_read_ts.

Source

fn determine_timestamp_for( &self, session: &Session, id_bundle: &CollectionIdBundle, when: &QueryWhen, compute_instance: ComputeInstanceId, timeline_context: &TimelineContext, oracle_read_ts: Option<Timestamp>, real_time_recency_ts: Option<Timestamp>, isolation_level: &IsolationLevel, constraint_based: &ConstraintBasedTimestampSelection, ) -> Result<(TimestampDetermination<Timestamp>, ReadHolds<Timestamp>), AdapterError>

Determines the timestamp for a query.

Timestamp determination may fail due to the restricted validity of traces. Each has a since and upper frontier, and are only valid after since and sure to be available not after upper.

The timeline that id_bundle belongs to is also returned, if one exists.

Source

fn least_valid_read( &self, read_holds: &ReadHolds<Timestamp>, ) -> Antichain<Timestamp>

The smallest common valid read frontier among times in the given ReadHolds.

Source

fn least_valid_write( &self, id_bundle: &CollectionIdBundle, ) -> Antichain<Timestamp>

The smallest common valid write frontier among the specified collections.

Times that are not greater or equal to this frontier are complete for all collections identified as arguments.

Source

fn greatest_available_read( &self, id_bundle: &CollectionIdBundle, ) -> Antichain<Timestamp>

Returns least_valid_write - 1, i.e., each time in least_valid_write stepped back in a saturating way.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§