Skip to content

Commit

Permalink
Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sanketkedia committed Dec 5, 2024
1 parent 14019e7 commit 301e6c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 0 additions & 2 deletions rust/index/src/spann/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<f32>,
}

Expand Down Expand Up @@ -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(),
Expand Down
9 changes: 8 additions & 1 deletion rust/worker/src/execution/operators/spann_fetch_pl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};

Expand All @@ -14,6 +14,7 @@ pub struct SpannFetchPlInput {
head_id: u32,
}

#[allow(dead_code)]
#[derive(Debug)]
pub struct SpannFetchPlOutput {
posting_list: Vec<SpannPosting>,
Expand All @@ -40,6 +41,7 @@ impl ChromaError for SpannFetchPlError {
pub struct SpannFetchPlOperator {}

impl SpannFetchPlOperator {
#[allow(dead_code)]
pub fn new() -> Box<Self> {
Box::new(SpannFetchPlOperator {})
}
Expand Down Expand Up @@ -67,4 +69,9 @@ impl Operator<SpannFetchPlInput, SpannFetchPlOutput> for SpannFetchPlOperator {
.map_err(|_| SpannFetchPlError::SpannSegmentReaderError)?;
Ok(SpannFetchPlOutput { posting_list })
}

// This operator is IO bound.
fn get_type(&self) -> OperatorType {
OperatorType::IO
}
}
2 changes: 1 addition & 1 deletion rust/worker/src/segment/spann_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 301e6c7

Please sign in to comment.