File tree Expand file tree Collapse file tree
duva/src/domains/cluster_actors Expand file tree Collapse file tree Original file line number Diff line number Diff 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 (
You can’t perform that action at this time.
0 commit comments