Skip to main content

DurableCatalogState

Trait DurableCatalogState 

Source
pub trait DurableCatalogState: ReadOnlyDurableCatalogState {
Show 14 methods // Required methods fn is_read_only(&self) -> bool; fn is_savepoint(&self) -> bool; fn mark_bootstrap_complete<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + 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; fn transaction_from_snapshot( &mut self, snapshot: Snapshot, ) -> Result<DryRunTransaction<'_>, CatalogError>; fn commit_transaction<'life0, 'async_trait>( &'life0 mut self, txn_batch: TransactionBatch, commit_ts: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Timestamp, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn advance_upper<'life0, 'async_trait>( &'life0 mut self, new_upper: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<(), CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn allocate_id<'life0, 'life1, 'async_trait>( &'life0 mut self, id_type: &'life1 str, amount: u64, commit_ts: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Vec<u64>, CatalogError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn shard_id(&self) -> ShardId; // Provided methods fn allocate_user_ids<'life0, 'async_trait>( &'life0 mut self, amount: u64, commit_ts: Timestamp, ) -> 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, commit_ts: Timestamp, ) -> 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, commit_ts: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<ClusterId, CatalogError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn allocate_user_replica_ids<'life0, 'async_trait>( &'life0 mut self, amount: u64, commit_ts: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Vec<ReplicaId>, CatalogError>> + Send + 'async_trait>> where Self: Send + 'async_trait, 'life0: 'async_trait { ... } fn allocate_system_replica_ids<'life0, 'async_trait>( &'life0 mut self, amount: u64, commit_ts: Timestamp, ) -> Pin<Box<dyn Future<Output = Result<Vec<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§

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

Marks the bootstrap process as complete.

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 transaction only if no durable catalog content is pending.

Empty upper progress is accepted.

Source

fn transaction_from_snapshot( &mut self, snapshot: Snapshot, ) -> Result<DryRunTransaction<'_>, CatalogError>

Creates a non-committable dry-run transaction from the given Snapshot.

The snapshot may include changes accumulated by earlier incremental dry runs.

Source

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

Commits a durable catalog state transaction. The transaction will be committed at commit_ts.

Returns what the upper was directly after the transaction committed.

Panics if commit_ts is not greater than or equal to the most recent upper seen by this process.

Source

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

Advances the catalog upper to at least new_upper.

A durable attempt observes fencing and reports concurrent non-fencing content as DurableCatalogError::CatalogOutOfSync. A no-op only validates a fence already observed by this handle.

Source

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

Allocates and returns amount IDs of id_type.

Allocation rebases over empty upper progress. Fresh IDs do not require a catalog staleness check.

Source

fn shard_id(&self) -> ShardId

Provided Methods§

Source

fn allocate_user_ids<'life0, 'async_trait>( &'life0 mut self, amount: u64, commit_ts: Timestamp, ) -> 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 many user CatalogItemId and GlobalId.

See Self::commit_transaction for details on commit_ts.

Source

fn allocate_user_id<'life0, 'async_trait>( &'life0 mut self, commit_ts: Timestamp, ) -> 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.

See Self::commit_transaction for details on commit_ts.

Source

fn allocate_user_cluster_id<'life0, 'async_trait>( &'life0 mut self, commit_ts: Timestamp, ) -> 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.

See Self::commit_transaction for details on commit_ts.

Source

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

Allocates and returns amount many user ReplicaIds.

See Self::commit_transaction for details on commit_ts.

Source

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

Allocates and returns amount many system ReplicaIds.

See Self::commit_transaction for details on commit_ts.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§