pub trait ReadOnlyDurableCatalogState: Debug + Send {
Show 14 methods // Required methods fn epoch(&self) -> Epoch; fn expire<'async_trait>( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where Self: 'async_trait; fn is_bootstrap_complete(&self) -> bool; fn get_audit_logs<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionedEvent>, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_next_id<'life0, 'life1, 'async_trait>( &'life0 mut self, id_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_deployment_generation<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn snapshot<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Snapshot, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_to_current_updates<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<StateUpdate>, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn sync_updates<'life0, 'async_trait>( &'life0 mut self, target_upper: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Vec<StateUpdate>, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn current_upper<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Timestamp> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn get_next_user_item_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_next_system_item_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_next_system_replica_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_next_user_replica_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

A read only API for the durable catalog state.

Required Methods§

source

fn epoch(&self) -> Epoch

Returns the epoch of the current durable catalog state. The epoch acts as a fencing token to prevent split brain issues across two DurableCatalogStates. When a new DurableCatalogState opens the catalog, it will increment the epoch by one (or initialize it to some value if there’s no existing epoch) and store the value in memory. It’s guaranteed that no two DurableCatalogStates will return the same value for their epoch.

NB: We may remove this in later iterations of Pv2.

source

fn expire<'async_trait>( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,

Politely releases all external resources that can only be released in an async context.

source

fn is_bootstrap_complete(&self) -> bool

Returns true if the system bootstrapping process is complete, false otherwise.

source

fn get_audit_logs<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<VersionedEvent>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all audit log events.

Results are guaranteed to be sorted by ID.

WARNING: This is meant for use in integration tests and has bad performance.

source

fn get_next_id<'life0, 'life1, 'async_trait>( &'life0 mut self, id_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get the next ID of id_type, without allocating it.

source

fn get_deployment_generation<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the deployment generation of this instance.

source

fn snapshot<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Snapshot, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a snapshot of the catalog.

source

fn sync_to_current_updates<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Vec<StateUpdate>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Listen and return all updates that are currently in the catalog.

IMPORTANT: This excludes updates to storage usage.

Returns an error if this instance has been fenced out.

source

fn sync_updates<'life0, 'async_trait>( &'life0 mut self, target_upper: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Vec<StateUpdate>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Listen and return all updates in the catalog up to target_upper.

IMPORTANT: This excludes updates to storage usage.

Returns an error if this instance has been fenced out.

source

fn current_upper<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Timestamp> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the current upper of the catalog state.

Provided Methods§

source

fn get_next_user_item_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the next user ID without allocating it.

source

fn get_next_system_item_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the next system ID without allocating it.

source

fn get_next_system_replica_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the next system replica id without allocating it.

source

fn get_next_user_replica_id<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the next user replica id without allocating it.

Implementors§