mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
Merge only 3 MTBL at the same time
This commit is contained in:
parent
5cc81a0179
commit
2174042994
@ -280,7 +280,7 @@ fn main() -> anyhow::Result<()> {
|
||||
|
||||
let index = Index::new(&env)?;
|
||||
|
||||
let stores: Vec<_> = opt.files_to_index
|
||||
let mut stores: Vec<_> = opt.files_to_index
|
||||
.into_par_iter()
|
||||
.map(|path| {
|
||||
let rdr = csv::Reader::from_path(path)?;
|
||||
@ -291,7 +291,14 @@ fn main() -> anyhow::Result<()> {
|
||||
})
|
||||
.collect::<Result<_, _>>()?;
|
||||
|
||||
let mtbl_store = MtblKvStore::from_many(stores)?;
|
||||
while stores.len() > 1 {
|
||||
let s = std::mem::take(&mut stores);
|
||||
stores = s.into_par_iter().chunks(3)
|
||||
.map(MtblKvStore::from_many)
|
||||
.collect::<Result<_, _>>()?;
|
||||
}
|
||||
|
||||
let mtbl_store = stores.pop().unwrap_or_default();
|
||||
|
||||
eprintln!("We are writing into LMDB...");
|
||||
let mut wtxn = env.write_txn()?;
|
||||
|
Loading…
Reference in New Issue
Block a user