Skip to content

Commit aae9b6b

Browse files
committed
remove unused method
1 parent 26246c4 commit aae9b6b

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

duva/src/domains/cluster_actors/hash_ring.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,17 @@ impl HashRing {
9191
.map(|(_, node_id)| node_id.as_ref())
9292
}
9393

94-
fn find_node(&self, hash: u64) -> Option<&PeerIdentifier> {
95-
// Find the first vnode with hash >= target hash
96-
self.pnodes.get(self.find_replid(hash)?)
97-
}
98-
9994
/// Verifies that all given keys belong to the specified node according to the hash ring
10095
pub(crate) fn verify_key_belongs_to_node(
10196
&self,
10297
keys: &[&str],
10398
expected_node: &PeerIdentifier,
10499
) -> bool {
105-
keys.iter().all(|key| self.find_node(fnv_1a_hash(key)) == Some(expected_node))
100+
keys.iter().all(|key| {
101+
self.find_replid(fnv_1a_hash(key))
102+
.and_then(|repl_id| self.pnodes.get(&repl_id))
103+
.map_or(false, |node| node == expected_node)
104+
})
106105
}
107106

108107
pub(crate) fn create_migration_tasks(

0 commit comments

Comments
 (0)