diff options
author | Alex Auvolat <alex@adnab.me> | 2022-03-15 12:04:12 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-03-23 10:25:15 +0100 |
commit | c1d9854d2c5998adcad60784ec54659113c28a9f (patch) | |
tree | cb6bd08213ac4b97f91f9bb9ffb83244d5180e97 /src/model/garage.rs | |
parent | 8565f7dc314f194ba85e9a0c8a021b9565c22e36 (diff) | |
download | garage-c1d9854d2c5998adcad60784ec54659113c28a9f.tar.gz garage-c1d9854d2c5998adcad60784ec54659113c28a9f.zip |
Move block manager to separate module
Diffstat (limited to 'src/model/garage.rs')
-rw-r--r-- | src/model/garage.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/model/garage.rs b/src/model/garage.rs index 78b4433a..3f2605f1 100644 --- a/src/model/garage.rs +++ b/src/model/garage.rs @@ -11,8 +11,8 @@ use garage_table::replication::ReplicationMode; use garage_table::replication::TableFullReplication; use garage_table::replication::TableShardedReplication; use garage_table::*; +use garage_block::manager::*; -use crate::block::*; use crate::block_ref_table::*; use crate::bucket_alias_table::*; use crate::bucket_table::*; @@ -87,7 +87,10 @@ impl Garage { info!("Initialize block manager..."); let block_manager = - BlockManager::new(&db, config.data_dir.clone(), data_rep_param, system.clone()); + BlockManager::new(&db, + config.data_dir.clone(), + config.compression_level, + data_rep_param, system.clone()); info!("Initialize block_ref_table..."); let block_ref_table = Table::new( @@ -151,17 +154,11 @@ impl Garage { }); info!("Start block manager background thread..."); - garage.block_manager.garage.swap(Some(garage.clone())); garage.block_manager.clone().spawn_background_worker(); garage } - /// Use this for shutdown - pub fn break_reference_cycles(&self) { - self.block_manager.garage.swap(None); - } - pub fn bucket_helper(&self) -> helper::bucket::BucketHelper { helper::bucket::BucketHelper(self) } |