diff options
author | Trinity Pointard <trinity.pointard@gmail.com> | 2021-04-06 05:25:28 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-04-27 16:47:08 +0200 |
commit | 74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88 (patch) | |
tree | d33d89915de29eb69e1b527c686f26358fcd2b45 /src/rpc/ring.rs | |
parent | 16300bbd89235dfb5852413cd451535559664594 (diff) | |
download | garage-74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88.tar.gz garage-74373aebcfdfcf5c03e4fb6510d8dd664a0b9b88.zip |
make most requested changes
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r-- | src/rpc/ring.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs index 6f341fa8..04f8b590 100644 --- a/src/rpc/ring.rs +++ b/src/rpc/ring.rs @@ -1,4 +1,5 @@ //! Module containing types related to computing nodes which should receive a copy of data blocks +//! and metadata use std::collections::{HashMap, HashSet}; use std::convert::TryInto; @@ -197,7 +198,7 @@ impl Ring { top >> (16 - PARTITION_BITS) } - /// Get the list of partitions and + /// Get the list of partitions and the first hash of a partition key that would fall in it pub fn partitions(&self) -> Vec<(Partition, Hash)> { let mut ret = vec![]; @@ -211,6 +212,7 @@ impl Ring { ret } + // TODO rename this function as it no longer walk the ring /// Walk the ring to find the n servers in which data should be replicated pub fn walk_ring(&self, from: &Hash, n: usize) -> Vec<UUID> { if self.ring.len() != 1 << PARTITION_BITS { |