pub trait OpenableDurableCatalogState: Debug + Send {
Show 14 methods
// Required methods
fn open_savepoint<'life0, 'async_trait>(
self: Box<Self>,
initial_ts: EpochMillis,
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_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,
) -> 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<u64, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_enable_0dt_deployment<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_0dt_deployment_max_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Duration>, CatalogError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_enable_0dt_deployment_panic_after_timeout<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, 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, DurableCatalogError>> + 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§
sourcefn open_savepoint<'life0, 'async_trait>(
self: Box<Self>,
initial_ts: EpochMillis,
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_savepoint<'life0, 'async_trait>(
self: Box<Self>,
initial_ts: EpochMillis,
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 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.
Once a savepoint catalog reads an initial snapshot from durable storage, it will never read another update from durable storage. As a consequence, savepoint catalogs can never be fenced.
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.
sourcefn 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_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.
sourcefn open<'life0, 'async_trait>(
self: Box<Self>,
initial_ts: EpochMillis,
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,
) -> 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.
sourcefn open_debug<'async_trait>(
self: Box<Self>,
) -> Pin<Box<dyn Future<Output = Result<DebugCatalogState, CatalogError>> + Send + 'async_trait>>where
Self: '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,
Opens the catalog for manual editing of the underlying data. This is helpful for fixing a corrupt catalog.
sourcefn 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 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.
sourcefn 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 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
DurableCatalogState
s. 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 DurableCatalogState
s will return the same value
for their epoch.
NB: We may remove this in later iterations of Pv2.
sourcefn get_deployment_generation<'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_deployment_generation<'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 most recent deployment generation written to the catalog. Not necessarily the deploy generation of this instance.
sourcefn get_enable_0dt_deployment<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_enable_0dt_deployment<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the enable_0dt_deployment
config value of this instance.
This mirrors the enable_0dt_deployment
“system var” so that we can
toggle the flag with LaunchDarkly, but use it in boot before
LaunchDarkly is available.
sourcefn get_0dt_deployment_max_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Duration>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_0dt_deployment_max_wait<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Duration>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the with_0dt_deployment_max_wait
config value of this instance.
This mirrors the with_0dt_deployment_max_wait
“system var” so that we can
toggle the flag with LaunchDarkly, but use it in boot before
LaunchDarkly is available.
sourcefn get_enable_0dt_deployment_panic_after_timeout<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_enable_0dt_deployment_panic_after_timeout<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<bool>, CatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the enable_0dt_deployment_panic_after_timeout
config value of this
instance.
This mirrors the enable_0dt_deployment_panic_after_timeout
“system var”
so that we can toggle the flag with LaunchDarkly, but use it in boot
before LaunchDarkly is available.
sourcefn has_system_config_synced_once<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<bool, DurableCatalogError>> + 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, DurableCatalogError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reports if the remote configuration was synchronized at least once.
sourcefn 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_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.
sourcefn 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 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.