Trait mz_adapter::TimestampProvider

source ·
pub trait TimestampProvider {
    // Required methods
    fn compute_read_frontier<'a>(
        &'a self,
        instance: ComputeInstanceId,
        id: GlobalId
    ) -> AntichainRef<'a, Timestamp>;
    fn compute_read_capability<'a>(
        &'a self,
        instance: ComputeInstanceId,
        id: GlobalId
    ) -> &'a Antichain<Timestamp>;
    fn compute_write_frontier<'a>(
        &'a self,
        instance: ComputeInstanceId,
        id: GlobalId
    ) -> AntichainRef<'a, Timestamp>;
    fn storage_frontiers(
        &self,
        ids: Vec<GlobalId>
    ) -> Vec<(GlobalId, Antichain<Timestamp>, Antichain<Timestamp>)>;
    fn catalog_state(&self) -> &CatalogState;
    fn acquire_read_holds(
        &mut 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_for<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 mut self,
        session: &'life1 Session,
        id_bundle: &'life2 CollectionIdBundle,
        when: &'life3 QueryWhen,
        compute_instance: ComputeInstanceId,
        timeline_context: &'life4 TimelineContext,
        oracle_read_ts: Option<Timestamp>,
        real_time_recency_ts: Option<Timestamp>,
        isolation_level: &'life5 IsolationLevel
    ) -> Pin<Box<dyn Future<Output = Result<(TimestampDetermination<Timestamp>, ReadHolds<Timestamp>), AdapterError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait { ... }
    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<'a>( &'a self, instance: ComputeInstanceId, id: GlobalId ) -> AntichainRef<'a, Timestamp>

source

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

source

fn compute_write_frontier<'a>( &'a self, instance: ComputeInstanceId, id: GlobalId ) -> AntichainRef<'a, 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( &mut 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_for<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 mut self, session: &'life1 Session, id_bundle: &'life2 CollectionIdBundle, when: &'life3 QueryWhen, compute_instance: ComputeInstanceId, timeline_context: &'life4 TimelineContext, oracle_read_ts: Option<Timestamp>, real_time_recency_ts: Option<Timestamp>, isolation_level: &'life5 IsolationLevel ) -> Pin<Box<dyn Future<Output = Result<(TimestampDetermination<Timestamp>, ReadHolds<Timestamp>), AdapterError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

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.

Object Safety§

This trait is not object safe.

Implementors§