Trait DatasetIndexExt

Source
pub trait DatasetIndexExt {
    // Required methods
    fn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 mut self,
        columns: &'life1 [&'life2 str],
        index_type: IndexType,
        name: Option<String>,
        params: &'life3 dyn IndexParams,
        replace: bool,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn drop_index<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load_indices<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<Vec<Index>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn load_scalar_index_for_column<'life0, 'life1, 'async_trait>(
        &'life0 self,
        col: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn optimize_indices<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        options: &'life1 OptimizeOptions,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn index_statistics<'life0, 'life1, 'async_trait>(
        &'life0 self,
        index_name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn commit_existing_index<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        index_name: &'life1 str,
        column: &'life2 str,
        index_id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn load_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uuid: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn load_indices_by_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Index>>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn create_index<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, columns: &'life1 [&'life2 str], index_type: IndexType, name: Option<String>, params: &'life3 dyn IndexParams, replace: bool, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Create indices on columns.

Upon finish, a new dataset version is generated.

Parameters:

  • columns: the columns to build the indices on.
  • index_type: specify IndexType.
  • name: optional index name. Must be unique in the dataset. if not provided, it will auto-generate one.
  • params: index parameters.
  • replace: replace the existing index if it exists.
Source

fn drop_index<'life0, 'life1, 'async_trait>( &'life0 mut self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Drop indices by name.

Upon finish, a new dataset version is generated.

Parameters:

  • name: the name of the index to drop.
Source

fn load_indices<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Arc<Vec<Index>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read all indices of this Dataset version.

The indices are lazy loaded and cached in memory within the [Dataset] instance. The cache is invalidated when the dataset version (Manifest) is changed.

Source

fn load_scalar_index_for_column<'life0, 'life1, 'async_trait>( &'life0 self, col: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads a specific index with the given index name.

Source

fn optimize_indices<'life0, 'life1, 'async_trait>( &'life0 mut self, options: &'life1 OptimizeOptions, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Optimize indices.

Source

fn index_statistics<'life0, 'life1, 'async_trait>( &'life0 self, index_name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Find index with a given index_name and return its serialized statistics.

If the index does not exist, return Error.

Source

fn commit_existing_index<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, index_name: &'life1 str, column: &'life2 str, index_id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Provided Methods§

Source

fn load_index<'life0, 'life1, 'async_trait>( &'life0 self, uuid: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads all the indies of a given UUID.

Note that it is possible to have multiple indices with the same UUID, as they are the deltas of the same index.

Source

fn load_indices_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Index>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Loads a specific index with the given index name

§Returns
  • Ok(indices): if the index exists, returns the index.
  • Ok(vec![]): if the index does not exist.
  • Err(e): if there is an error loading indices.

Implementors§