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 prewarm_index<'life0, 'life1, 'async_trait>(
        &'life0 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<'a, 'b, 'async_trait>(
        &'a self,
        criteria: ScalarIndexCriteria<'b>,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'b: '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;
    fn read_index_partition<'life0, 'life1, 'async_trait>(
        &'life0 self,
        index_name: &'life1 str,
        partition_id: usize,
        with_vector: bool,
    ) -> Pin<Box<dyn Future<Output = Result<SendableRecordBatchStream>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: '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 { ... }
    fn load_index_by_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<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 prewarm_index<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Prewarm an index by name.

This will load the index into memory and cache it.

Generally, this should only be called when it is known the entire index will fit into the index cache.

This is a hint that is not enforced by all indices today. Some indices may choose to ignore this hint.

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<'a, 'b, 'async_trait>( &'a self, criteria: ScalarIndexCriteria<'b>, ) -> Pin<Box<dyn Future<Output = Result<Option<Index>>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'b: '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,

Source

fn read_index_partition<'life0, 'life1, 'async_trait>( &'life0 self, index_name: &'life1 str, partition_id: usize, with_vector: bool, ) -> Pin<Box<dyn Future<Output = Result<SendableRecordBatchStream>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: '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.
Source

fn load_index_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'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 a specific index with the given index name. This function only works for indices that are unique. If there are multiple indices sharing the same name, please use [load_indices_by_name]

§Returns
  • Ok(Some(index)): if the index exists, returns the index.
  • Ok(None): if the index does not exist.
  • Err(e): Index error if there are multiple indexes sharing the same name.

Implementors§