diff --git a/rust/index/src/hnsw_provider.rs b/rust/index/src/hnsw_provider.rs index cff58eea0b0a..7f4b66e742df 100644 --- a/rust/index/src/hnsw_provider.rs +++ b/rust/index/src/hnsw_provider.rs @@ -356,7 +356,7 @@ impl HnswIndexProvider { // A query comes in and the index is not in the cache -> we need to load the index from s3 based on the segment files id pub async fn create( &self, - collection_id: &Uuid, + collection_id: &CollectionUuid, hnsw_params: HnswIndexParams, persist_path: &std::path::Path, dimensionality: i32, diff --git a/rust/worker/src/segment/distributed_hnsw_segment.rs b/rust/worker/src/segment/distributed_hnsw_segment.rs index af0a23dfcb5a..54edba0c4b17 100644 --- a/rust/worker/src/segment/distributed_hnsw_segment.rs +++ b/rust/worker/src/segment/distributed_hnsw_segment.rs @@ -11,9 +11,9 @@ use chroma_index::{ HnswIndexConfig, HnswIndexFromSegmentError, Index, IndexConfig, IndexConfigFromSegmentError, IndexUuid, }; -use chroma_index::{Index, DEFAULT_HNSW_EF_CONSTRUCTION, DEFAULT_HNSW_EF_SEARCH, DEFAULT_HNSW_M}; +use chroma_index::{DEFAULT_HNSW_EF_CONSTRUCTION, DEFAULT_HNSW_EF_SEARCH, DEFAULT_HNSW_M}; +use chroma_types::SegmentUuid; use chroma_types::{get_metadata_value_as, MaterializedLogOperation, MetadataValue, Segment}; -use chroma_types::{MaterializedLogOperation, Segment, SegmentUuid}; use std::collections::HashMap; use std::fmt::Debug; use thiserror::Error; @@ -428,7 +428,7 @@ pub mod test { HnswIndexConfig, DEFAULT_HNSW_EF_CONSTRUCTION, DEFAULT_HNSW_EF_SEARCH, DEFAULT_HNSW_M, DEFAULT_MAX_ELEMENTS, }; - use chroma_types::{MetadataValue, Segment}; + use chroma_types::{CollectionUuid, MetadataValue, Segment, SegmentUuid}; use tempfile::tempdir; use uuid::Uuid; @@ -439,11 +439,11 @@ pub mod test { let persist_path = tempdir().unwrap().path().to_owned(); let segment = Segment { - id: Uuid::new_v4(), + id: SegmentUuid(Uuid::new_v4()), r#type: chroma_types::SegmentType::HnswDistributed, scope: chroma_types::SegmentScope::VECTOR, metadata: Some(HashMap::new()), - collection: Uuid::new_v4(), + collection: CollectionUuid(Uuid::new_v4()), file_path: HashMap::new(), }; @@ -464,11 +464,11 @@ pub mod test { metadata.insert("hnsw:M".to_string(), MetadataValue::Int(10_i64)); let segment = Segment { - id: Uuid::new_v4(), + id: SegmentUuid(Uuid::new_v4()), r#type: chroma_types::SegmentType::HnswDistributed, scope: chroma_types::SegmentScope::VECTOR, metadata: Some(metadata), - collection: Uuid::new_v4(), + collection: CollectionUuid(Uuid::new_v4()), file_path: HashMap::new(), };