Skip to main content

Catalog

Trait Catalog 

Source
pub trait Catalog: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn list_namespaces<'life0, 'life1, 'async_trait>(
        &'life0 self,
        parent: Option<&'life1 [String]>,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<Vec<Vec<String>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_namespace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 [String],
        properties: NamespaceProperties,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn drop_namespace<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn namespace_properties<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = CatalogResult<NamespaceProperties>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_tables<'life0, 'life1, 'async_trait>(
        &'life0 self,
        namespace: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = CatalogResult<Vec<TableIdentifier>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_table<'life0, 'life1, 'async_trait>(
        &'life0 self,
        identifier: &'life1 TableIdentifier,
        metadata: TableMetadata,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<TableMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load_table<'life0, 'life1, 'async_trait>(
        &'life0 self,
        identifier: &'life1 TableIdentifier,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<TableMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn drop_table<'life0, 'life1, 'async_trait>(
        &'life0 self,
        identifier: &'life1 TableIdentifier,
        purge: bool,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn rename_table<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        from: &'life1 TableIdentifier,
        to: &'life2 TableIdentifier,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn table_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        identifier: &'life1 TableIdentifier,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<bool>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn commit_table<'life0, 'life1, 'async_trait>(
        &'life0 self,
        identifier: &'life1 TableIdentifier,
        base_version: i64,
        metadata: TableMetadata,
    ) -> Pin<Box<dyn Future<Output = CatalogResult<TableMetadata>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

The main catalog trait for managing tables.

Required Methods§

Source

fn name(&self) -> &str

Returns the name of this catalog.

Source

fn list_namespaces<'life0, 'life1, 'async_trait>( &'life0 self, parent: Option<&'life1 [String]>, ) -> Pin<Box<dyn Future<Output = CatalogResult<Vec<Vec<String>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Lists all namespaces, optionally under a parent namespace.

Source

fn create_namespace<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 [String], properties: NamespaceProperties, ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new namespace.

Source

fn drop_namespace<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 [String], ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Drops a namespace (must be empty).

Source

fn namespace_properties<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 [String], ) -> Pin<Box<dyn Future<Output = CatalogResult<NamespaceProperties>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Gets namespace properties.

Source

fn list_tables<'life0, 'life1, 'async_trait>( &'life0 self, namespace: &'life1 [String], ) -> Pin<Box<dyn Future<Output = CatalogResult<Vec<TableIdentifier>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Lists all tables in a namespace.

Source

fn create_table<'life0, 'life1, 'async_trait>( &'life0 self, identifier: &'life1 TableIdentifier, metadata: TableMetadata, ) -> Pin<Box<dyn Future<Output = CatalogResult<TableMetadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Creates a new table.

Source

fn load_table<'life0, 'life1, 'async_trait>( &'life0 self, identifier: &'life1 TableIdentifier, ) -> Pin<Box<dyn Future<Output = CatalogResult<TableMetadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads a table’s metadata.

Source

fn drop_table<'life0, 'life1, 'async_trait>( &'life0 self, identifier: &'life1 TableIdentifier, purge: bool, ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Drops a table.

Source

fn rename_table<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, from: &'life1 TableIdentifier, to: &'life2 TableIdentifier, ) -> Pin<Box<dyn Future<Output = CatalogResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Renames a table.

Source

fn table_exists<'life0, 'life1, 'async_trait>( &'life0 self, identifier: &'life1 TableIdentifier, ) -> Pin<Box<dyn Future<Output = CatalogResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Checks if a table exists.

Source

fn commit_table<'life0, 'life1, 'async_trait>( &'life0 self, identifier: &'life1 TableIdentifier, base_version: i64, metadata: TableMetadata, ) -> Pin<Box<dyn Future<Output = CatalogResult<TableMetadata>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Atomically updates table metadata using compare-and-swap.

§Arguments
  • identifier - The table to update
  • base_version - The expected current version (sequence number)
  • metadata - The new metadata to commit
§Returns

The committed metadata on success.

Implementors§