aboutsummaryrefslogtreecommitdiff
path: root/src/table/merkle.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-16 11:47:39 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-16 11:47:39 +0100
commit0aad2f2e066b5914ac94bb319e7679e2e7761b2b (patch)
tree81b52a8b8647c0ba0ce44e3ffc554ec46a84b0b2 /src/table/merkle.rs
parent515029d026937d29395379c76188f509984b8ace (diff)
downloadgarage-0aad2f2e066b5914ac94bb319e7679e2e7761b2b.tar.gz
garage-0aad2f2e066b5914ac94bb319e7679e2e7761b2b.zip
some reordering
Diffstat (limited to 'src/table/merkle.rs')
-rw-r--r--src/table/merkle.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/table/merkle.rs b/src/table/merkle.rs
index 8c3dcad9..86fef4c5 100644
--- a/src/table/merkle.rs
+++ b/src/table/merkle.rs
@@ -38,7 +38,6 @@ pub fn hash_of_merkle_partition_opt(p: Option<MerklePartition>) -> Hash {
pub struct MerkleUpdater<F: TableSchema, R: TableReplication> {
data: Arc<TableData<F, R>>,
- background: Arc<BackgroundRunner>,
// Content of the todo tree: items where
// - key = the key of an item in the main table, ie hash(partition_key)+sort_key
@@ -86,19 +85,18 @@ where
R: TableReplication + 'static,
{
pub(crate) fn launch(
+ background: &BackgroundRunner,
data: Arc<TableData<F, R>>,
- background: Arc<BackgroundRunner>,
) -> Arc<Self> {
let empty_node_hash = blake2sum(&rmp_to_vec_all_named(&MerkleNode::Empty).unwrap()[..]);
let ret = Arc::new(Self {
data,
- background,
empty_node_hash,
});
let ret2 = ret.clone();
- ret.background.spawn_worker(
+ background.spawn_worker(
format!("Merkle tree updater for {}", ret.data.name),
|must_exit: watch::Receiver<bool>| ret2.updater_loop(must_exit),
);