pub trait OpenableDurableCatalogState: Debug + Send {
    // Required methods
    fn open_savepoint<'life0, 'async_trait>(
        self: Box<Self>,
        initial_ts: EpochMillis,
        bootstrap_args: &'life0 BootstrapArgs,
        deploy_generation: Option<u64>,
        epoch_lower_bound: Option<Epoch>
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DurableCatalogState>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn open_read_only<'life0, 'async_trait>(
        self: Box<Self>,
        bootstrap_args: &'life0 BootstrapArgs
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DurableCatalogState>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn open<'life0, 'async_trait>(
        self: Box<Self>,
        initial_ts: EpochMillis,
        bootstrap_args: &'life0 BootstrapArgs,
        deploy_generation: Option<u64>,
        epoch_lower_bound: Option<Epoch>
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DurableCatalogState>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn open_debug<'async_trait>(
        self: Box<Self>
    ) -> Pin<Box<dyn Future<Output = Result<DebugCatalogState, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait;
    fn is_initialized<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<bool, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn epoch<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Epoch, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_deployment_generation<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Option<u64>, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn has_system_config_synced_once<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<bool, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn trace_unconsolidated<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Trace, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn trace_consolidated<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<Trace, CatalogError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn expire<'async_trait>(
        self: Box<Self>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait;
}
Expand description

An API for opening a durable catalog state.

If a catalog is not opened, then resources should be release via Self::expire.

Required Methods§

source

fn open_savepoint<'life0, 'async_trait>( self: Box<Self>, initial_ts: EpochMillis, bootstrap_args: &'life0 BootstrapArgs, deploy_generation: Option<u64>, epoch_lower_bound: Option<Epoch> ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DurableCatalogState>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Opens the catalog in a mode that accepts and buffers all writes, but never durably commits them. This is used to check and see if opening the catalog would be successful, without making any durable changes.

epoch_lower_bound is used as a lower bound for the epoch that is used by the returned catalog.

Will return an error in the following scenarios:

  • Catalog initialization fails.
  • Catalog migrations fail.

initial_ts is used as the initial timestamp for new environments.

source

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

Opens the catalog in read only mode. All mutating methods will return an error.

If the catalog is uninitialized or requires a migrations, then it will fail to open in read only mode.

source

fn open<'life0, 'async_trait>( self: Box<Self>, initial_ts: EpochMillis, bootstrap_args: &'life0 BootstrapArgs, deploy_generation: Option<u64>, epoch_lower_bound: Option<Epoch> ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DurableCatalogState>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Opens the catalog in a writeable mode. Optionally initializes the catalog, if it has not been initialized, and perform any migrations needed.

initial_ts is used as the initial timestamp for new environments. epoch_lower_bound is used as a lower bound for the epoch that is used by the returned catalog.

source

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

Opens the catalog for manual editing of the underlying data. This is helpful for fixing a corrupt catalog.

source

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

Reports if the catalog state has been initialized.

source

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

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

Get the deployment generation of this instance.

source

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

Reports if the remote configuration was synchronized at least once.

source

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

Generate an unconsolidated Trace of catalog contents.

source

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

Generate a consolidated Trace of catalog contents.

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.

Implementors§