pub trait BTreeSubIndex:
Debug
+ Send
+ Sync
+ DeepSizeOf {
// Required methods
fn train<'life0, 'async_trait>(
&'life0 self,
batch: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_subindex<'life0, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ScalarIndex>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn retrieve_data<'life0, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn schema(&self) -> &Arc<Schema>;
fn remap_subindex<'life0, 'life1, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
mapping: &'life1 HashMap<u64, Option<u64>>,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
A trait that must be implemented by anything that wishes to act as a btree subindex
Required Methods§
Sourcefn train<'life0, 'async_trait>(
&'life0 self,
batch: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn train<'life0, 'async_trait>(
&'life0 self,
batch: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Trains the subindex on a single batch of data and serializes it to Arrow
Sourcefn load_subindex<'life0, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ScalarIndex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_subindex<'life0, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ScalarIndex>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Deserialize a subindex from Arrow
Sourcefn retrieve_data<'life0, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn retrieve_data<'life0, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve the data used to originally train this page
In order to perform an update we need to merge the old data in with the new data which means we need to access the new data. Right now this is convenient for flat indices but we may need to take a different approach if we ever decide to use a sub-index other than flat
Sourcefn remap_subindex<'life0, 'life1, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
mapping: &'life1 HashMap<u64, Option<u64>>,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remap_subindex<'life0, 'life1, 'async_trait>(
&'life0 self,
serialized: RecordBatch,
mapping: &'life1 HashMap<u64, Option<u64>>,
) -> Pin<Box<dyn Future<Output = Result<RecordBatch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Given a serialized page, deserialize it, remap the row ids, and re-serialize it