diff options
author | Alex Auvolat <alex@adnab.me> | 2021-03-10 14:52:03 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-03-10 14:52:03 +0100 |
commit | 6a3dcf39740cda27e61b93582b6fea66991ec4f2 (patch) | |
tree | 2312393b8b468785f124f54e3494b8dbe6474d1e /src/rpc/ring.rs | |
parent | 7cda917b6b91a1533afb3b066e4a90269c61c871 (diff) | |
download | garage-6a3dcf39740cda27e61b93582b6fea66991ec4f2.tar.gz garage-6a3dcf39740cda27e61b93582b6fea66991ec4f2.zip |
Rename n_tokens into capacity
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r-- | src/rpc/ring.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/rpc/ring.rs b/src/rpc/ring.rs index ee0b52ef..85caafeb 100644 --- a/src/rpc/ring.rs +++ b/src/rpc/ring.rs @@ -35,7 +35,7 @@ impl NetworkConfig { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct NetworkConfigEntry { pub datacenter: String, - pub n_tokens: u32, + pub capacity: u32, pub tag: String, } @@ -88,10 +88,10 @@ impl Ring { }) .collect::<Vec<_>>(); - let max_toktok = config + let max_capacity = config .members .iter() - .map(|(_, node_info)| node_info.n_tokens) + .map(|(_, node_info)| node_info.capacity) .fold(0, std::cmp::max); // Fill up ring @@ -108,9 +108,9 @@ impl Ring { let mut remaining = partitions_idx.len(); while remaining > 0 { let remaining0 = remaining; - for toktok in 0..max_toktok { + for i_round in 0..max_capacity { for (node_id, node_info, q, pos) in queues.iter_mut() { - if toktok >= node_info.n_tokens { + if i_round >= node_info.capacity { continue; } for pos2 in *pos..q.len() { |