mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
Merge #566
566: Introduce the copy_to_path method on the Index r=irevoire a=Kerollmops Meilisearch needs this method to do snapshots. Co-authored-by: Kerollmops <clement@meilisearch.com>
This commit is contained in:
commit
68bb170732
@ -1,11 +1,12 @@
|
|||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::{HashMap, HashSet};
|
use std::collections::{HashMap, HashSet};
|
||||||
|
use std::fs::File;
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use heed::flags::Flags;
|
use heed::flags::Flags;
|
||||||
use heed::types::*;
|
use heed::types::*;
|
||||||
use heed::{Database, PolyDatabase, RoTxn, RwTxn};
|
use heed::{CompactionOption, Database, PolyDatabase, RoTxn, RwTxn};
|
||||||
use roaring::RoaringBitmap;
|
use roaring::RoaringBitmap;
|
||||||
use rstar::RTree;
|
use rstar::RTree;
|
||||||
use time::OffsetDateTime;
|
use time::OffsetDateTime;
|
||||||
@ -214,6 +215,10 @@ impl Index {
|
|||||||
self.env.path()
|
self.env.path()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn copy_to_path<P: AsRef<Path>>(&self, path: P, option: CompactionOption) -> Result<File> {
|
||||||
|
self.env.copy_to_path(path, option).map_err(Into::into)
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns an `EnvClosingEvent` that can be used to wait for the closing event,
|
/// Returns an `EnvClosingEvent` that can be used to wait for the closing event,
|
||||||
/// multiple threads can wait on this event.
|
/// multiple threads can wait on this event.
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user