Fix progress of into_changes

This commit is contained in:
Clément Renault 2024-11-20 15:10:09 +01:00
parent 867138f166
commit 8380ddbdcd
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F
11 changed files with 101 additions and 6 deletions

View File

@ -150,6 +150,7 @@ fn indexing_songs_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -215,6 +216,7 @@ fn reindexing_songs_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -258,6 +260,7 @@ fn reindexing_songs_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -325,6 +328,7 @@ fn deleting_songs_in_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -400,6 +404,7 @@ fn indexing_songs_in_three_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -443,6 +448,7 @@ fn indexing_songs_in_three_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -482,6 +488,7 @@ fn indexing_songs_in_three_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -548,6 +555,7 @@ fn indexing_songs_without_faceted_numbers(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -613,6 +621,7 @@ fn indexing_songs_without_faceted_fields(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -678,6 +687,7 @@ fn indexing_wiki(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -742,6 +752,7 @@ fn reindexing_wiki(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -785,6 +796,7 @@ fn reindexing_wiki(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -851,6 +863,7 @@ fn deleting_wiki_in_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -926,6 +939,7 @@ fn indexing_wiki_in_three_batches(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -970,6 +984,7 @@ fn indexing_wiki_in_three_batches(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1010,6 +1025,7 @@ fn indexing_wiki_in_three_batches(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1075,6 +1091,7 @@ fn indexing_movies_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1139,6 +1156,7 @@ fn reindexing_movies_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1182,6 +1200,7 @@ fn reindexing_movies_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1248,6 +1267,7 @@ fn deleting_movies_in_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1358,6 +1378,7 @@ fn indexing_movies_in_three_batches(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1401,6 +1422,7 @@ fn indexing_movies_in_three_batches(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1440,6 +1462,7 @@ fn indexing_movies_in_three_batches(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1528,6 +1551,7 @@ fn indexing_nested_movies_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1617,6 +1641,7 @@ fn deleting_nested_movies_in_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1698,6 +1723,7 @@ fn indexing_nested_movies_without_faceted_fields(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1763,6 +1789,7 @@ fn indexing_geo(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1827,6 +1854,7 @@ fn reindexing_geo(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1870,6 +1898,7 @@ fn reindexing_geo(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -1936,6 +1965,7 @@ fn deleting_geo_in_batches_default(c: &mut Criterion) {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();

View File

@ -103,7 +103,15 @@ pub fn base_setup(conf: &Conf) -> Index {
let indexer_alloc = Bump::new(); let indexer_alloc = Bump::new();
let (document_changes, _operation_stats, primary_key) = indexer let (document_changes, _operation_stats, primary_key) = indexer
.into_changes(&indexer_alloc, &index, &rtxn, None, &mut new_fields_ids_map, &|| false) .into_changes(
&indexer_alloc,
&index,
&rtxn,
None,
&mut new_fields_ids_map,
&|| false,
&|_progress| (),
)
.unwrap(); .unwrap();
indexer::index( indexer::index(

View File

@ -128,6 +128,7 @@ fn main() {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();

View File

@ -1344,6 +1344,7 @@ impl IndexScheduler {
primary_key.as_deref(), primary_key.as_deref(),
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| must_stop_processing.get(), &|| must_stop_processing.get(),
&send_progress,
)?; )?;
let mut addition = 0; let mut addition = 0;

View File

@ -1764,6 +1764,7 @@ pub(crate) mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
)?; )?;
if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) { if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) {
@ -1853,6 +1854,7 @@ pub(crate) mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
)?; )?;
if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) { if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) {
@ -1932,6 +1934,7 @@ pub(crate) mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();

View File

@ -65,7 +65,15 @@ pub fn setup_search_index_with_criteria(criteria: &[Criterion]) -> Index {
let indexer_alloc = Bump::new(); let indexer_alloc = Bump::new();
let (document_changes, operation_stats, primary_key) = indexer let (document_changes, operation_stats, primary_key) = indexer
.into_changes(&indexer_alloc, &index, &rtxn, None, &mut new_fields_ids_map, &|| false) .into_changes(
&indexer_alloc,
&index,
&rtxn,
None,
&mut new_fields_ids_map,
&|| false,
&|_progress| (),
)
.unwrap(); .unwrap();
if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) { if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) {

View File

@ -1947,6 +1947,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2130,6 +2131,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2190,6 +2192,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2241,6 +2244,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2291,6 +2295,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2343,6 +2348,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2400,6 +2406,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2450,6 +2457,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2500,6 +2508,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2692,6 +2701,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2749,6 +2759,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();
@ -2803,6 +2814,7 @@ mod tests {
None, None,
&mut new_fields_ids_map, &mut new_fields_ids_map,
&|| false, &|| false,
&|_progress| (),
) )
.unwrap(); .unwrap();

View File

@ -50,7 +50,15 @@ fn test_facet_distribution_with_no_facet_values() {
let indexer_alloc = Bump::new(); let indexer_alloc = Bump::new();
let (document_changes, _operation_stats, primary_key) = indexer let (document_changes, _operation_stats, primary_key) = indexer
.into_changes(&indexer_alloc, &index, &rtxn, None, &mut new_fields_ids_map, &|| false) .into_changes(
&indexer_alloc,
&index,
&rtxn,
None,
&mut new_fields_ids_map,
&|| false,
&|_progress| (),
)
.unwrap(); .unwrap();
indexer::index( indexer::index(

View File

@ -83,7 +83,15 @@ pub fn setup_search_index_with_criteria(criteria: &[Criterion]) -> Index {
let indexer_alloc = Bump::new(); let indexer_alloc = Bump::new();
let (document_changes, operation_stats, primary_key) = indexer let (document_changes, operation_stats, primary_key) = indexer
.into_changes(&indexer_alloc, &index, &rtxn, None, &mut new_fields_ids_map, &|| false) .into_changes(
&indexer_alloc,
&index,
&rtxn,
None,
&mut new_fields_ids_map,
&|| false,
&|_progress| (),
)
.unwrap(); .unwrap();
if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) { if let Some(error) = operation_stats.into_iter().find_map(|stat| stat.error) {

View File

@ -319,7 +319,15 @@ fn criteria_ascdesc() {
let payload = unsafe { memmap2::Mmap::map(&file).unwrap() }; let payload = unsafe { memmap2::Mmap::map(&file).unwrap() };
indexer.add_documents(&payload).unwrap(); indexer.add_documents(&payload).unwrap();
let (document_changes, _operation_stats, primary_key) = indexer let (document_changes, _operation_stats, primary_key) = indexer
.into_changes(&indexer_alloc, &index, &rtxn, None, &mut new_fields_ids_map, &|| false) .into_changes(
&indexer_alloc,
&index,
&rtxn,
None,
&mut new_fields_ids_map,
&|| false,
&|_progress| (),
)
.unwrap(); .unwrap();
indexer::index( indexer::index(

View File

@ -128,7 +128,15 @@ fn test_typo_disabled_on_word() {
let indexer_alloc = Bump::new(); let indexer_alloc = Bump::new();
let (document_changes, _operation_stats, primary_key) = indexer let (document_changes, _operation_stats, primary_key) = indexer
.into_changes(&indexer_alloc, &index, &rtxn, None, &mut new_fields_ids_map, &|| false) .into_changes(
&indexer_alloc,
&index,
&rtxn,
None,
&mut new_fields_ids_map,
&|| false,
&|_progress| (),
)
.unwrap(); .unwrap();
indexer::index( indexer::index(