Move step to a dedicated mod and replace it with an enum

This commit is contained in:
Louis Dureuil
2024-11-18 18:22:13 +01:00
parent 75943a5a9b
commit c782c09208
12 changed files with 111 additions and 189 deletions

View File

@ -14,6 +14,7 @@ use crate::update::new::indexer::document_changes::{
extract, DocumentChangeContext, DocumentChanges, Extractor, IndexingContext, Progress,
};
use crate::update::new::ref_cell_ext::RefCellExt as _;
use crate::update::new::steps::Step;
use crate::update::new::thread_local::{FullySend, MostlySend, ThreadLocal};
use crate::update::new::DocumentChange;
use crate::update::GrenadParameters;
@ -249,9 +250,7 @@ impl WordDocidsExtractors {
document_changes: &DC,
indexing_context: IndexingContext<'fid, 'indexer, 'index, MSP, SP>,
extractor_allocs: &'extractor mut ThreadLocal<FullySend<Bump>>,
finished_steps: u16,
total_steps: u16,
step_name: &'static str,
step: Step,
) -> Result<WordDocidsCaches<'extractor>>
where
MSP: Fn() -> bool + Sync,
@ -306,9 +305,7 @@ impl WordDocidsExtractors {
indexing_context,
extractor_allocs,
&datastore,
finished_steps,
total_steps,
step_name,
step,
)?;
}

View File

@ -16,6 +16,7 @@ use super::DocidsExtractor;
use crate::update::new::indexer::document_changes::{
extract, DocumentChangeContext, DocumentChanges, Extractor, IndexingContext, Progress,
};
use crate::update::new::steps::Step;
use crate::update::new::thread_local::{FullySend, ThreadLocal};
use crate::update::new::DocumentChange;
use crate::update::GrenadParameters;
@ -60,9 +61,7 @@ pub trait SearchableExtractor: Sized + Sync {
document_changes: &DC,
indexing_context: IndexingContext<'fid, 'indexer, 'index, MSP, SP>,
extractor_allocs: &'extractor mut ThreadLocal<FullySend<Bump>>,
finished_steps: u16,
total_steps: u16,
step_name: &'static str,
step: Step,
) -> Result<Vec<BalancedCaches<'extractor>>>
where
MSP: Fn() -> bool + Sync,
@ -115,9 +114,7 @@ pub trait SearchableExtractor: Sized + Sync {
indexing_context,
extractor_allocs,
&datastore,
finished_steps,
total_steps,
step_name,
step,
)?;
}
@ -142,9 +139,7 @@ impl<T: SearchableExtractor> DocidsExtractor for T {
document_changes: &DC,
indexing_context: IndexingContext<'fid, 'indexer, 'index, MSP, SP>,
extractor_allocs: &'extractor mut ThreadLocal<FullySend<Bump>>,
finished_steps: u16,
total_steps: u16,
step_name: &'static str,
step: Step,
) -> Result<Vec<BalancedCaches<'extractor>>>
where
MSP: Fn() -> bool + Sync,
@ -155,9 +150,7 @@ impl<T: SearchableExtractor> DocidsExtractor for T {
document_changes,
indexing_context,
extractor_allocs,
finished_steps,
total_steps,
step_name,
step,
)
}
}