diff --git a/crates/milli/src/progress.rs b/crates/milli/src/progress.rs index fd56c46d6..728e95652 100644 --- a/crates/milli/src/progress.rs +++ b/crates/milli/src/progress.rs @@ -269,47 +269,6 @@ impl Step for VariableNameStep { } } -// impl Step for hannoy::MainStep { -// fn name(&self) -> Cow<'static, str> { -// match self { -// hannoy::MainStep::PreProcessingTheItems => "pre processing the items", -// hannoy::MainStep::WritingTheDescendantsAndMetadata => { -// "writing the descendants and metadata" -// } -// hannoy::MainStep::RetrieveTheUpdatedItems => "retrieve the updated items", -// hannoy::MainStep::RetrievingTheTreeAndItemNodes => "retrieving the tree and item nodes", -// hannoy::MainStep::UpdatingTheTrees => "updating the trees", -// hannoy::MainStep::CreateNewTrees => "create new trees", -// hannoy::MainStep::WritingNodesToDatabase => "writing nodes to database", -// hannoy::MainStep::DeleteExtraneousTrees => "delete extraneous trees", -// hannoy::MainStep::WriteTheMetadata => "write the metadata", -// } -// .into() -// } - -// fn current(&self) -> u32 { -// *self as u32 -// } - -// fn total(&self) -> u32 { -// Self::CARDINALITY as u32 -// } -// } - -// impl Step for hannoy::SubStep { -// fn name(&self) -> Cow<'static, str> { -// self.unit.into() -// } - -// fn current(&self) -> u32 { -// self.current.load(Ordering::Relaxed) -// } - -// fn total(&self) -> u32 { -// self.max -// } -// } - // Integration with steppe impl steppe::Progress for Progress { @@ -322,7 +281,7 @@ struct Compat(T); impl Step for Compat { fn name(&self) -> Cow<'static, str> { - self.0.name().into() + self.0.name() } fn current(&self) -> u32 { diff --git a/crates/milli/src/update/upgrade/v1_18.rs b/crates/milli/src/update/upgrade/v1_18.rs index e20696b84..ef46e1f5b 100644 --- a/crates/milli/src/update/upgrade/v1_18.rs +++ b/crates/milli/src/update/upgrade/v1_18.rs @@ -14,7 +14,7 @@ impl UpgradeIndex for Latest_V1_17_To_V1_18_0 { wtxn: &mut RwTxn, index: &Index, _original: (u32, u32, u32), - _progress: Progress, + progress: Progress, ) -> Result { let embedding_configs = index.embedding_configs(); for config in embedding_configs.embedding_configs(wtxn)? { @@ -22,7 +22,7 @@ impl UpgradeIndex for Latest_V1_17_To_V1_18_0 { let quantized = config.config.quantized(); let embedder_id = embedding_configs.embedder_id(wtxn, &config.name)?.unwrap(); let vector_store = VectorStore::new(index.vector_store, embedder_id, quantized); - vector_store.convert_from_arroy(wtxn)?; + vector_store.convert_from_arroy(wtxn, progress.clone())?; } Ok(false) diff --git a/crates/milli/src/vector/mod.rs b/crates/milli/src/vector/mod.rs index 0a97a9bde..181a13e6a 100644 --- a/crates/milli/src/vector/mod.rs +++ b/crates/milli/src/vector/mod.rs @@ -155,7 +155,7 @@ impl VectorStore { } } - pub fn convert_from_arroy(&self, wtxn: &mut RwTxn) -> crate::Result<()> { + pub fn convert_from_arroy(&self, wtxn: &mut RwTxn, progress: Progress) -> crate::Result<()> { if self.quantized { let dimensions = self .arroy_readers(wtxn, self.arroy_quantized_db()) @@ -168,7 +168,7 @@ impl VectorStore { for index in vector_store_range_for_embedder(self.embedder_index) { let mut rng = rand::rngs::StdRng::from_entropy(); let writer = hannoy::Writer::new(self.quantized_db(), index, dimensions); - let mut builder = writer.builder(&mut rng); + let mut builder = writer.builder(&mut rng).progress(progress.clone()); builder.prepare_arroy_conversion(wtxn)?; builder.build::(wtxn)?; } @@ -186,7 +186,7 @@ impl VectorStore { for index in vector_store_range_for_embedder(self.embedder_index) { let mut rng = rand::rngs::StdRng::from_entropy(); let writer = hannoy::Writer::new(self.angular_db(), index, dimensions); - let mut builder = writer.builder(&mut rng); + let mut builder = writer.builder(&mut rng).progress(progress.clone()); builder.prepare_arroy_conversion(wtxn)?; builder.build::(wtxn)?; }