aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/ring.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-03-10 14:52:03 +0100
committerAlex Auvolat <alex@adnab.me>2021-03-10 14:52:03 +0100
commit6a3dcf39740cda27e61b93582b6fea66991ec4f2 (patch)
tree2312393b8b468785f124f54e3494b8dbe6474d1e /src/rpc/ring.rs
parent7cda917b6b91a1533afb3b066e4a90269c61c871 (diff)
downloadgarage-6a3dcf39740cda27e61b93582b6fea66991ec4f2.tar.gz
garage-6a3dcf39740cda27e61b93582b6fea66991ec4f2.zip
Rename n_tokens into capacity
Diffstat (limited to 'src/rpc/ring.rs')
-rw-r--r--src/rpc/ring.rs10
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() {