From 867e6a8f1dc2fc7a1fbc5e351335213f2eb8ea6c Mon Sep 17 00:00:00 2001 From: Tamo Date: Tue, 10 Dec 2024 17:04:04 +0100 Subject: [PATCH] rename the send_progress field to progress since it s not sending anything --- .../src/update/new/indexer/document_changes.rs | 5 ++--- .../src/update/new/indexer/document_deletion.rs | 2 +- crates/milli/src/update/new/indexer/mod.rs | 16 +++++++--------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/crates/milli/src/update/new/indexer/document_changes.rs b/crates/milli/src/update/new/indexer/document_changes.rs index 799763658..3e2b9c036 100644 --- a/crates/milli/src/update/new/indexer/document_changes.rs +++ b/crates/milli/src/update/new/indexer/document_changes.rs @@ -144,8 +144,7 @@ pub struct IndexingContext< pub doc_allocs: &'indexer ThreadLocal>>, pub fields_ids_map_store: &'indexer ThreadLocal>>>, pub must_stop_processing: &'indexer MSP, - // TODO: TAMO: Rename field to progress - pub send_progress: &'indexer Progress, + pub progress: &'indexer Progress, } impl< @@ -207,7 +206,7 @@ pub fn extract< doc_allocs, fields_ids_map_store, must_stop_processing, - send_progress, + progress: send_progress, }: IndexingContext<'fid, 'indexer, 'index, MSP>, extractor_allocs: &'extractor mut ThreadLocal>, datastore: &'data ThreadLocal, diff --git a/crates/milli/src/update/new/indexer/document_deletion.rs b/crates/milli/src/update/new/indexer/document_deletion.rs index 33e69e49c..b42a6c859 100644 --- a/crates/milli/src/update/new/indexer/document_deletion.rs +++ b/crates/milli/src/update/new/indexer/document_deletion.rs @@ -165,7 +165,7 @@ mod test { doc_allocs: &doc_allocs, fields_ids_map_store: &fields_ids_map_store, must_stop_processing: &(|| false), - send_progress: &Progress::default(), + progress: &Progress::default(), }; for _ in 0..3 { diff --git a/crates/milli/src/update/new/indexer/mod.rs b/crates/milli/src/update/new/indexer/mod.rs index 79416bcd5..acdf78304 100644 --- a/crates/milli/src/update/new/indexer/mod.rs +++ b/crates/milli/src/update/new/indexer/mod.rs @@ -125,7 +125,7 @@ where doc_allocs: &doc_allocs, fields_ids_map_store: &fields_ids_map_store, must_stop_processing, - send_progress, + progress: send_progress, }; let mut index_embeddings = index.embedding_configs(wtxn)?; @@ -383,7 +383,7 @@ where &indexing_context.must_stop_processing, )?; } - indexing_context.send_progress.update_progress(IndexingStep::WritingToDatabase); + indexing_context.progress.update_progress(IndexingStep::WritingToDatabase); finished_extraction.store(true, std::sync::atomic::Ordering::Relaxed); Result::Ok((facet_field_ids_delta, index_embeddings)) @@ -483,7 +483,7 @@ where )?; } - indexing_context.send_progress.update_progress(IndexingStep::WaitingForExtractors); + indexing_context.progress.update_progress(IndexingStep::WaitingForExtractors); let (facet_field_ids_delta, index_embeddings) = extractor_handle.join().unwrap()?; @@ -496,9 +496,7 @@ where break 'vectors; } - indexing_context - .send_progress - .update_progress(IndexingStep::WritingEmbeddingsToDatabase); + indexing_context.progress.update_progress(IndexingStep::WritingEmbeddingsToDatabase); let mut rng = rand::rngs::StdRng::seed_from_u64(42); for (_index, (_embedder_name, _embedder, writer, dimensions)) in &mut arroy_writers { let dimensions = *dimensions; @@ -514,19 +512,19 @@ where index.put_embedding_configs(wtxn, index_embeddings)?; } - indexing_context.send_progress.update_progress(IndexingStep::PostProcessingFacets); + indexing_context.progress.update_progress(IndexingStep::PostProcessingFacets); if index.facet_search(wtxn)? { compute_facet_search_database(index, wtxn, global_fields_ids_map)?; } compute_facet_level_database(index, wtxn, facet_field_ids_delta)?; - indexing_context.send_progress.update_progress(IndexingStep::PostProcessingWords); + indexing_context.progress.update_progress(IndexingStep::PostProcessingWords); if let Some(prefix_delta) = compute_word_fst(index, wtxn)? { compute_prefix_database(index, wtxn, prefix_delta, grenad_parameters)?; } - indexing_context.send_progress.update_progress(IndexingStep::Finalizing); + indexing_context.progress.update_progress(IndexingStep::Finalizing); Ok(()) as Result<_> })?;