Trait mz_catalog::durable::DurableCatalogState

source ·
pub trait DurableCatalogState: ReadOnlyDurableCatalogState {
    // Required methods
    fn is_read_only(&self) -> bool;
    fn is_savepoint(&self) -> bool;
    fn transaction<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Transaction<'_>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn commit_transaction<'life0, 'async_trait>(
        &'life0 mut self,
        txn_batch: TransactionBatch,
    ) -> Pin<Box<dyn Future<Output = Result<Timestamp, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn confirm_leadership<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(), CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn allocate_id<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        id_type: &'life1 str,
        amount: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, CatalogError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn allocate_system_ids<'life0, 'async_trait>(
        &'life0 mut self,
        amount: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(CatalogItemId, GlobalId)>, CatalogError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn allocate_user_id<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<(CatalogItemId, GlobalId), CatalogError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
    fn allocate_user_cluster_id<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<ClusterId, CatalogError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

A read-write API for the durable catalog state.

Required Methods§

source

fn is_read_only(&self) -> bool

Returns true if the catalog is opened in read only mode, false otherwise.

source

fn is_savepoint(&self) -> bool

Returns true if the catalog is opened is savepoint mode, false otherwise.

source

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

Creates a new durable catalog state transaction.

source

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

Commits a durable catalog state transaction.

Returns the upper that the transaction was committed at.

source

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

Confirms that this catalog is connected as the current leader.

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

Provided Methods§

source

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

Allocates and returns amount IDs of id_type.

source

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

Allocates and returns amount system CatalogItemIds.

source

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

Allocates and returns both a user CatalogItemId and GlobalId.

source

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

Allocates and returns a user ClusterId.

Implementors§