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§
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>
sourcefn storage_frontiers(
&self,
ids: Vec<GlobalId>
) -> Vec<(GlobalId, Antichain<Timestamp>, Antichain<Timestamp>)>
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.
fn catalog_state(&self) -> &CatalogState
sourcefn acquire_read_holds(
&mut self,
id_bundle: &CollectionIdBundle
) -> ReadHolds<Timestamp>
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§
fn get_timeline(timeline_context: &TimelineContext) -> Option<Timeline>
sourcefn needs_linearized_read_ts(
isolation_level: &IsolationLevel,
when: &QueryWhen
) -> bool
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.
sourcefn 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 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.
sourcefn least_valid_read(
&self,
read_holds: &ReadHolds<Timestamp>
) -> Antichain<Timestamp>
fn least_valid_read( &self, read_holds: &ReadHolds<Timestamp> ) -> Antichain<Timestamp>
The smallest common valid read frontier among times in the given ReadHolds.
sourcefn least_valid_write(
&self,
id_bundle: &CollectionIdBundle
) -> Antichain<Timestamp>
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.
sourcefn greatest_available_read(
&self,
id_bundle: &CollectionIdBundle
) -> Antichain<Timestamp>
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.