Struct lance_index::vector::sq::storage::ScalarQuantizationStorage
source · pub struct ScalarQuantizationStorage { /* private fields */ }Implementations§
source§impl ScalarQuantizationStorage
impl ScalarQuantizationStorage
pub fn new( num_bits: u16, metric_type: MetricType, bounds: Range<f64>, batch: RecordBatch ) -> Result<Self>
pub fn num_bits(&self) -> u16
pub fn metric_type(&self) -> MetricType
pub fn bounds(&self) -> Range<f64>
pub fn batch(&self) -> &RecordBatch
pub fn row_ids(&self) -> &[u64]
pub fn sq_codes(&self) -> &Arc<FixedSizeListArray>
pub async fn load(object_store: &ObjectStore, path: &Path) -> Result<Self>
Trait Implementations§
source§impl Clone for ScalarQuantizationStorage
impl Clone for ScalarQuantizationStorage
source§fn clone(&self) -> ScalarQuantizationStorage
fn clone(&self) -> ScalarQuantizationStorage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl QuantizerStorage for ScalarQuantizationStorage
impl QuantizerStorage for ScalarQuantizationStorage
source§fn load_partition<'life0, 'life1, 'async_trait>(
reader: &'life0 FileReader,
range: Range<usize>,
metric_type: MetricType,
metadata: &'life1 Self::Metadata
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_partition<'life0, 'life1, 'async_trait>(
reader: &'life0 FileReader,
range: Range<usize>,
metric_type: MetricType,
metadata: &'life1 Self::Metadata
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load a partition of SQ storage from disk.
§Parameters
- *reader: file reader
- *range: row range of the partition
- *metric_type: metric type of the vectors
- *metadata: scalar quantization metadata
type Metadata = ScalarQuantizationMetadata
source§impl VectorStorage for ScalarQuantizationStorage
impl VectorStorage for ScalarQuantizationStorage
source§fn metric_type(&self) -> MetricType
fn metric_type(&self) -> MetricType
Return the metric type of the vectors.
source§fn dist_calculator(&self, query: &[f32]) -> Box<dyn DistCalculator>
fn dist_calculator(&self, query: &[f32]) -> Box<dyn DistCalculator>
Create a [DistCalculator] to compute the distance between the query.
Using dist calcualtor can be more efficient as it can pre-compute some values.
fn as_any(&self) -> &dyn Any
fn len(&self) -> usize
fn row_ids(&self) -> &[u64]
Auto Trait Implementations§
impl Freeze for ScalarQuantizationStorage
impl !RefUnwindSafe for ScalarQuantizationStorage
impl Send for ScalarQuantizationStorage
impl Sync for ScalarQuantizationStorage
impl Unpin for ScalarQuantizationStorage
impl !UnwindSafe for ScalarQuantizationStorage
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more