Trait IndexStore

Source
pub trait IndexStore:
    Debug
    + Send
    + Sync
    + DeepSizeOf {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn io_parallelism(&self) -> usize;
    fn new_index_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        schema: Arc<Schema>,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn IndexWriter>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn open_index_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn IndexReader>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn copy_index_file<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        dest_store: &'life2 dyn IndexStore,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Trait abstracting I/O away from index logic

Scalar indices are currently serialized as indexable arrow record batches stored in named “files”. The index store is responsible for serializing and deserializing these batches into file data (e.g. as .lance files or .parquet files, etc.)

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Source

fn io_parallelism(&self) -> usize

Suggested I/O parallelism for the store

Source

fn new_index_file<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, schema: Arc<Schema>, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn IndexWriter>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Create a new file and return a writer to store data in the file

Source

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

Open an existing file for retrieval

Source

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

Copy a range of batches from an index file from this store to another

This is often useful when remapping or updating

Implementors§