From 301e6c769950dd03ec18794ea20851cdbb1552a1 Mon Sep 17 00:00:00 2001 From: Sanket Kedia Date: Thu, 5 Dec 2024 14:42:05 -0800 Subject: [PATCH] Review comments --- rust/index/src/spann/types.rs | 2 -- rust/worker/src/execution/operators/spann_fetch_pl.rs | 9 ++++++++- rust/worker/src/segment/spann_segment.rs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rust/index/src/spann/types.rs b/rust/index/src/spann/types.rs index 1f97ce77a02d..f6556048c166 100644 --- a/rust/index/src/spann/types.rs +++ b/rust/index/src/spann/types.rs @@ -1402,7 +1402,6 @@ impl ChromaError for SpannIndexReaderError { #[derive(Debug)] pub struct SpannPosting { pub doc_offset_id: u32, - pub doc_version: u32, pub doc_embedding: Vec, } @@ -1540,7 +1539,6 @@ impl<'me> SpannIndexReader<'me> { } posting_lists.push(SpannPosting { doc_offset_id: *doc_offset_id, - doc_version: res.doc_versions[index], doc_embedding: res.doc_embeddings [index * self.dimensionality..(index + 1) * self.dimensionality] .to_vec(), diff --git a/rust/worker/src/execution/operators/spann_fetch_pl.rs b/rust/worker/src/execution/operators/spann_fetch_pl.rs index 8513b56af13f..316082380799 100644 --- a/rust/worker/src/execution/operators/spann_fetch_pl.rs +++ b/rust/worker/src/execution/operators/spann_fetch_pl.rs @@ -4,7 +4,7 @@ use thiserror::Error; use tonic::async_trait; use crate::{ - execution::operator::Operator, + execution::operator::{Operator, OperatorType}, segment::spann_segment::{SpannSegmentReader, SpannSegmentReaderContext}, }; @@ -14,6 +14,7 @@ pub struct SpannFetchPlInput { head_id: u32, } +#[allow(dead_code)] #[derive(Debug)] pub struct SpannFetchPlOutput { posting_list: Vec, @@ -40,6 +41,7 @@ impl ChromaError for SpannFetchPlError { pub struct SpannFetchPlOperator {} impl SpannFetchPlOperator { + #[allow(dead_code)] pub fn new() -> Box { Box::new(SpannFetchPlOperator {}) } @@ -67,4 +69,9 @@ impl Operator for SpannFetchPlOperator { .map_err(|_| SpannFetchPlError::SpannSegmentReaderError)?; Ok(SpannFetchPlOutput { posting_list }) } + + // This operator is IO bound. + fn get_type(&self) -> OperatorType { + OperatorType::IO + } } diff --git a/rust/worker/src/segment/spann_segment.rs b/rust/worker/src/segment/spann_segment.rs index 5642be940d5c..be5e7cbf2a77 100644 --- a/rust/worker/src/segment/spann_segment.rs +++ b/rust/worker/src/segment/spann_segment.rs @@ -8,8 +8,8 @@ use chroma_index::spann::types::{ }; use chroma_index::IndexUuid; use chroma_index::{hnsw_provider::HnswIndexProvider, spann::types::SpannIndexWriter}; +use chroma_types::SegmentUuid; use chroma_types::{MaterializedLogOperation, Segment, SegmentScope, SegmentType}; -use chroma_types::{SegmentUuid, SpannPostingList}; use thiserror::Error; use tonic::async_trait; use uuid::Uuid;