compaction profile used during migration, fixes #1750 (#1751)

* compaction profile used during migration, fixes #1750

* whitespace

[ci:skip]
This commit is contained in:
Marek Kotewicz
2016-07-28 20:29:58 +02:00
committed by Gav Wood
parent 171244a471
commit f33cd60dc2
8 changed files with 48 additions and 26 deletions

View File

@@ -29,12 +29,15 @@ use ::kvdb::{CompactionProfile, Database, DatabaseConfig, DBTransaction};
pub struct Config {
/// Defines how many elements should be migrated at once.
pub batch_size: usize,
/// Database compaction profile.
pub compaction_profile: CompactionProfile,
}
impl Default for Config {
fn default() -> Self {
Config {
batch_size: 1024,
compaction_profile: Default::default(),
}
}
}
@@ -199,7 +202,7 @@ impl Manager {
let db_config = DatabaseConfig {
max_open_files: 64,
cache_size: None,
compaction: CompactionProfile::default(),
compaction: config.compaction_profile.clone(),
};
let db_root = database_path(old_path);