aboutsummaryrefslogtreecommitdiff
path: root/src/table/merkle.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-12-14 12:34:01 +0100
committerAlex Auvolat <alex@adnab.me>2021-12-15 15:39:10 +0100
commit8f6026de5ecd44cbe0fc0bcd47638a1ece860439 (patch)
tree5adf96c2218aa27b59eeb66cda676895979d4257 /src/table/merkle.rs
parent945b75dbf1de8bb22ebf9824727a2c45561bfcf4 (diff)
downloadgarage-8f6026de5ecd44cbe0fc0bcd47638a1ece860439.tar.gz
garage-8f6026de5ecd44cbe0fc0bcd47638a1ece860439.zip
Make table name a const in trait
Diffstat (limited to 'src/table/merkle.rs')
-rw-r--r--src/table/merkle.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/table/merkle.rs b/src/table/merkle.rs
index 56f307d3..5ec6ab61 100644
--- a/src/table/merkle.rs
+++ b/src/table/merkle.rs
@@ -82,7 +82,7 @@ where
let ret2 = ret.clone();
background.spawn_worker(
- format!("Merkle tree updater for {}", ret.data.name),
+ format!("Merkle tree updater for {}", F::TABLE_NAME),
|must_exit: watch::Receiver<bool>| ret2.updater_loop(must_exit),
);
@@ -97,14 +97,16 @@ where
if let Err(e) = self.update_item(&key[..], &valhash[..]) {
warn!(
"({}) Error while updating Merkle tree item: {}",
- self.data.name, e
+ F::TABLE_NAME,
+ e
);
}
}
Err(e) => {
warn!(
"({}) Error while iterating on Merkle todo tree: {}",
- self.data.name, e
+ F::TABLE_NAME,
+ e
);
tokio::time::sleep(Duration::from_secs(10)).await;
}
@@ -147,7 +149,8 @@ where
if !deleted {
debug!(
"({}) Item not deleted from Merkle todo because it changed: {:?}",
- self.data.name, k
+ F::TABLE_NAME,
+ k
);
}
Ok(())
@@ -183,7 +186,7 @@ where
// should not happen
warn!(
"({}) Replacing intermediate node with empty node, should not happen.",
- self.data.name
+ F::TABLE_NAME
);
Some(MerkleNode::Empty)
} else if children.len() == 1 {
@@ -195,7 +198,7 @@ where
MerkleNode::Empty => {
warn!(
"({}) Single subnode in tree is empty Merkle node",
- self.data.name
+ F::TABLE_NAME
);
Some(MerkleNode::Empty)
}