start integrating the index-scheduler in meilisearch-lib

This commit is contained in:
Irevoire
2022-09-21 17:13:09 +02:00
committed by Clément Renault
parent 8f0fd35358
commit 250410495c
7 changed files with 163 additions and 146 deletions

View File

@ -107,6 +107,16 @@ impl IndexMapper {
Ok(index)
}
pub fn indexes(&self, rtxn: &RoTxn) -> Result<Vec<Index>> {
self.index_mapping
.iter(&rtxn)?
.map(|ret| {
ret.map_err(Error::from)
.and_then(|(name, _)| self.index(rtxn, name))
})
.collect()
}
/// Swap two index name.
pub fn swap(&self, wtxn: &mut RwTxn, lhs: &str, rhs: &str) -> Result<()> {
let lhs_uuid = self