Trait mz_catalog::durable::DurableCatalogState
source · pub trait DurableCatalogState: ReadOnlyDurableCatalogState {
// Required methods
fn is_read_only(&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<(), 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;
fn get_and_prune_storage_usage<'life0, 'async_trait>(
&'life0 mut self,
retention_period: Option<Duration>,
boot_ts: Timestamp,
wait_for_consolidation: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<VersionedStorageUsage>, 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<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<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 { ... }
fn allocate_user_replica_id<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<ReplicaId, CatalogError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn allocate_system_replica_id<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<ReplicaId, 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§
sourcefn is_read_only(&self) -> bool
fn is_read_only(&self) -> bool
Returns true if the catalog is opened in read only mode, false otherwise.
sourcefn 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 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.
sourcefn commit_transaction<'life0, 'async_trait>(
&'life0 mut self,
txn_batch: TransactionBatch
) -> Pin<Box<dyn Future<Output = Result<(), 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<(), CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Commits a durable catalog state transaction.
sourcefn 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,
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.
sourcefn get_and_prune_storage_usage<'life0, 'async_trait>(
&'life0 mut self,
retention_period: Option<Duration>,
boot_ts: Timestamp,
wait_for_consolidation: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<VersionedStorageUsage>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_and_prune_storage_usage<'life0, 'async_trait>(
&'life0 mut self,
retention_period: Option<Duration>,
boot_ts: Timestamp,
wait_for_consolidation: bool
) -> Pin<Box<dyn Future<Output = Result<Vec<VersionedStorageUsage>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Gets all storage usage events and permanently deletes from the catalog those that happened more than the retention period ago from boot_ts.
Results are guaranteed to be sorted by ID.
Provided Methods§
sourcefn 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_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
.
sourcefn allocate_system_ids<'life0, 'async_trait>(
&'life0 mut self,
amount: u64
) -> Pin<Box<dyn Future<Output = Result<Vec<GlobalId>, CatalogError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn allocate_system_ids<'life0, 'async_trait>(
&'life0 mut self,
amount: u64
) -> Pin<Box<dyn Future<Output = Result<Vec<GlobalId>, CatalogError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Allocates and returns amount
system GlobalId
s.
sourcefn allocate_user_id<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<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<GlobalId, CatalogError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Allocates and returns a user GlobalId
.
sourcefn 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,
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
.