Introduce some new routes to handle live indexing

This commit is contained in:
Clément Renault
2020-10-19 16:03:17 +02:00
parent d3145be744
commit 871222aebd
5 changed files with 215 additions and 125 deletions

View File

@ -148,7 +148,7 @@ impl<M: 'static> UpdateStore<M> {
}
/// Execute the user defined function with both meta-store iterators, the first
/// iterator is the *pending* meta one and the secind is the *processed* meta one.
/// iterator is the *processed* meta one and the secind is the *pending* meta one.
pub fn iter_metas<F, T>(&self, mut f: F) -> heed::Result<T>
where
M: for<'a> Deserialize<'a>,
@ -160,11 +160,11 @@ impl<M: 'static> UpdateStore<M> {
let rtxn = self.env.read_txn()?;
// We get both the pending and processed meta iterators.
let pending_iter = self.pending_meta.iter(&rtxn)?;
let processed_iter = self.processed_meta.iter(&rtxn)?;
let pending_iter = self.pending_meta.iter(&rtxn)?;
// We execute the user defined function with both iterators.
(f)(pending_iter, processed_iter)
(f)(processed_iter, pending_iter)
}
/// Returns the update associated meta or `None` if the update deosn't exist.