pub trait ReadOnlyDurableCatalogState: Debug + Send {
    // 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 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_persist_txn_tables<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Option<PersistTxnTablesImpl>, 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;

    // Provided methods
    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 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.

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_persist_txn_tables<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<Option<PersistTxnTablesImpl>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the persist_txn_tables config value of this instance.

This mirrors the persist_txn_tables “system var” so that we can toggle the flag with Launch Darkly, but use it in boot before Launch Darkly is available.

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.

Provided Methods§

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§