From 741a4444a9b8eb115db6585fcc4b2ecefc9ba52c Mon Sep 17 00:00:00 2001 From: many Date: Thu, 2 Sep 2021 16:57:46 +0200 Subject: [PATCH] Remove log in chunk generator --- .../index_documents/helpers/grenad_helpers.rs | 18 +----------------- milli/src/update/index_documents/mod.rs | 1 - milli/tests/search/mod.rs | 2 +- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/milli/src/update/index_documents/helpers/grenad_helpers.rs b/milli/src/update/index_documents/helpers/grenad_helpers.rs index 1dfaaf945..fbdf2b42e 100644 --- a/milli/src/update/index_documents/helpers/grenad_helpers.rs +++ b/milli/src/update/index_documents/helpers/grenad_helpers.rs @@ -129,10 +129,8 @@ impl GrenadParameters { pub fn grenad_obkv_into_chunks( mut reader: grenad::Reader, indexer: GrenadParameters, - log_frequency: Option, documents_chunk_size: usize, ) -> Result>>> { - let mut document_count = 0; let mut continue_reading = true; let indexer_clone = indexer.clone(); @@ -154,11 +152,6 @@ pub fn grenad_obkv_into_chunks( obkv_documents.insert(document_id, obkv)?; current_chunk_size += document_id.len() as u64 + obkv.len() as u64; - document_count += 1; - if log_frequency.map_or(false, |log_frequency| document_count % log_frequency == 0) { - debug!("reached {} chunked documents", document_count); - } - if current_chunk_size >= documents_chunk_size as u64 { return writer_into_reader(obkv_documents).map(Some); } @@ -168,16 +161,7 @@ pub fn grenad_obkv_into_chunks( writer_into_reader(obkv_documents).map(Some) }; - Ok(std::iter::from_fn(move || { - let result = transposer().transpose(); - if result.as_ref().map_or(false, |r| r.is_ok()) { - debug!( - "A new chunk of approximately {:.2} MiB has been generated", - documents_chunk_size as f64 / 1024.0 / 1024.0, - ); - } - result - })) + Ok(std::iter::from_fn(move || transposer().transpose())) } pub fn write_into_lmdb_database( diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index e4c798163..7800ae55a 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -250,7 +250,6 @@ impl<'t, 'u, 'i, 'a> IndexDocuments<'t, 'u, 'i, 'a> { let chunk_iter = grenad_obkv_into_chunks( documents_file, params.clone(), - self.log_every_n, self.documents_chunk_size.unwrap_or(1024 * 1024 * 128), // 128MiB ); diff --git a/milli/tests/search/mod.rs b/milli/tests/search/mod.rs index a533a4cbe..0fbc0e1b6 100644 --- a/milli/tests/search/mod.rs +++ b/milli/tests/search/mod.rs @@ -5,7 +5,7 @@ use big_s::S; use either::{Either, Left, Right}; use heed::EnvOpenOptions; use maplit::{hashmap, hashset}; -use milli::update::{IndexDocuments, Settings, UpdateBuilder, UpdateFormat}; +use milli::update::{Settings, UpdateBuilder, UpdateFormat}; use milli::{AscDesc, Criterion, DocumentId, Index}; use serde::Deserialize; use slice_group_by::GroupBy;