Move the IndexScheduler to the root of the index-scheduler crate

This commit is contained in:
Kerollmops 2022-10-03 16:15:10 +02:00 committed by Clément Renault
parent 78e730ca37
commit 257651c615
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
3 changed files with 691 additions and 696 deletions

View file

@ -5,6 +5,8 @@ use std::sync::Arc;
use std::sync::RwLock;
use index::Index;
use uuid::Uuid;
use milli::heed::types::SerdeBincode;
use milli::heed::types::Str;
use milli::heed::Database;
@ -12,11 +14,10 @@ use milli::heed::Env;
use milli::heed::RoTxn;
use milli::heed::RwTxn;
use milli::update::IndexerConfig;
use uuid::Uuid;
use crate::index_scheduler::db_name;
use crate::Error;
use crate::Result;
use crate::{Error, Result};
const INDEX_MAPPING: &str = "index-mapping";
#[derive(Clone)]
pub struct IndexMapper {
@ -41,7 +42,7 @@ impl IndexMapper {
) -> Result<Self> {
Ok(Self {
index_map: Arc::default(),
index_mapping: env.create_database(Some(db_name::INDEX_MAPPING))?,
index_mapping: env.create_database(Some(INDEX_MAPPING))?,
base_path,
index_size,
indexer_config: Arc::new(indexer_config),