From 6a3dcf39740cda27e61b93582b6fea66991ec4f2 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 10 Mar 2021 14:52:03 +0100 Subject: Rename n_tokens into capacity --- src/rpc/ring.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/rpc') 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::>(); - 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() { -- cgit v1.2.3