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 01847a14bb
commit acc6d3a82b
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
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