mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
load index dump
This commit is contained in:
parent
e818c33fec
commit
b924e897f1
11 changed files with 261 additions and 279 deletions
|
@ -1,8 +1,3 @@
|
|||
mod actor;
|
||||
mod handle_impl;
|
||||
mod message;
|
||||
mod loaders;
|
||||
|
||||
use std::{fs::File, path::Path};
|
||||
|
||||
use log::error;
|
||||
|
@ -18,6 +13,15 @@ pub use actor::DumpActor;
|
|||
pub use handle_impl::*;
|
||||
pub use message::DumpMsg;
|
||||
|
||||
use crate::option::IndexerOpts;
|
||||
|
||||
use super::uuid_resolver::store::UuidStore;
|
||||
|
||||
mod actor;
|
||||
mod handle_impl;
|
||||
mod loaders;
|
||||
mod message;
|
||||
|
||||
pub type DumpResult<T> = std::result::Result<T, DumpError>;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
@ -117,11 +121,12 @@ impl DumpInfo {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn load_dump(
|
||||
pub fn load_dump<U: UuidStore>(
|
||||
dst_path: impl AsRef<Path>,
|
||||
src_path: impl AsRef<Path>,
|
||||
_index_db_size: u64,
|
||||
_update_db_size: u64,
|
||||
indexer_opts: &IndexerOpts,
|
||||
) -> anyhow::Result<()> {
|
||||
let meta_path = src_path.as_ref().join("metadat.json");
|
||||
let mut meta_file = File::open(&meta_path)?;
|
||||
|
@ -129,7 +134,7 @@ pub fn load_dump(
|
|||
|
||||
match meta {
|
||||
Metadata::V1 { meta } => meta.load_dump(src_path, dst_path)?,
|
||||
Metadata::V2 { meta } => meta.load_dump(src_path, dst_path)?,
|
||||
Metadata::V2 { meta } => meta.load_dump(src_path.as_ref(), dst_path.as_ref(), indexer_opts)?,
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue