From 1eadced8f1d04b5e84d8a6179a895a5d1b6fe11a Mon Sep 17 00:00:00 2001 From: Lorenzo Selvatici Date: Fri, 30 Aug 2019 18:06:26 +0200 Subject: [PATCH] fixed warnings --- Cargo.lock | 36 ++++++++++++++++++------------------ Cargo.toml | 4 ++-- src/kafka.rs | 2 +- src/lib.rs | 8 ++++---- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b242a5..a8373b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,14 +121,14 @@ dependencies = [ [[package]] name = "dynamic_scaling_mechanism" version = "0.0.1" -source = "git+https://github.com/LorenzSelv/megaphone?branch=rescaling#7165b1dd57da824426cca627e57e30e97dfc6e62" +source = "git+https://github.com/strymon-system/megaphone?branch=rescaling#4f95d4945396bcb5b5ad241ef668d2d8ce351c3e" dependencies = [ "abomonation 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "abomonation_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "num 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "timely 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", + "timely 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", "zipf 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -462,14 +462,14 @@ dependencies = [ "abomonation 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "dynamic_scaling_mechanism 0.0.1 (git+https://github.com/LorenzSelv/megaphone?branch=rescaling)", + "dynamic_scaling_mechanism 0.0.1 (git+https://github.com/strymon-system/megaphone?branch=rescaling)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "hdrhist 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "math 0.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "rdkafka 0.14.1 (registry+https://github.com/rust-lang/crates.io-index)", "streaming-harness 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "timely 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", + "timely 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", ] [[package]] @@ -595,41 +595,41 @@ dependencies = [ [[package]] name = "timely" version = "0.10.0" -source = "git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" +source = "git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" dependencies = [ "abomonation 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "abomonation_derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "colored 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "timely_bytes 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", - "timely_communication 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", - "timely_logging 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", + "timely_bytes 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", + "timely_communication 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", + "timely_logging 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", ] [[package]] name = "timely_bytes" version = "0.10.0" -source = "git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" +source = "git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" [[package]] name = "timely_communication" version = "0.10.0" -source = "git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" +source = "git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" dependencies = [ "abomonation 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "abomonation_derive 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.99 (registry+https://github.com/rust-lang/crates.io-index)", - "timely_bytes 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", - "timely_logging 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)", + "timely_bytes 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", + "timely_logging 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)", ] [[package]] name = "timely_logging" version = "0.10.0" -source = "git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" +source = "git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p#a8b3b93efe9befcc0cba6e78c5e7c38676a39c67" [[package]] name = "unicode-width" @@ -720,7 +720,7 @@ dependencies = [ "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum colored 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6cdb90b60f2927f8d76139c72dbde7e10c3a2bc47c8594c9c7a66529f2687c03" -"checksum dynamic_scaling_mechanism 0.0.1 (git+https://github.com/LorenzSelv/megaphone?branch=rescaling)" = "" +"checksum dynamic_scaling_mechanism 0.0.1 (git+https://github.com/strymon-system/megaphone?branch=rescaling)" = "" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "checksum futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" @@ -776,10 +776,10 @@ dependencies = [ "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -"checksum timely 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)" = "" -"checksum timely_bytes 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)" = "" -"checksum timely_communication 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)" = "" -"checksum timely_logging 0.10.0 (git+https://github.com/LorenzSelv/timely-dataflow/?branch=rescaling-p2p)" = "" +"checksum timely 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)" = "" +"checksum timely_bytes 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)" = "" +"checksum timely_communication 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)" = "" +"checksum timely_logging 0.10.0 (git+https://github.com/strymon-system/timely-dataflow/?branch=rescaling-p2p)" = "" "checksum unicode-width 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" diff --git a/Cargo.toml b/Cargo.toml index 18d5c34..664caa1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,8 +5,8 @@ authors = ["Lorenzo Selvatici "] edition = "2018" [dependencies] -timely = { git = "https://github.com/LorenzSelv/timely-dataflow/", branch = "rescaling-p2p" } -dynamic_scaling_mechanism = { git = "https://github.com/LorenzSelv/megaphone", branch = "rescaling", features = ["bin-3"], default-features = false } +timely = { git = "https://github.com/strymon-system/timely-dataflow/", branch = "rescaling-p2p" } +dynamic_scaling_mechanism = { git = "https://github.com/strymon-system/megaphone", branch = "rescaling", features = ["bin-3"], default-features = false } colored = "1.8.0" rdkafka = "0.14.1" math="0.0.2" diff --git a/src/kafka.rs b/src/kafka.rs index 13192c2..9d21b37 100644 --- a/src/kafka.rs +++ b/src/kafka.rs @@ -47,7 +47,7 @@ pub fn control_stream>(scope: &mut G, input_probe: Pro move |output| { if let Some(consumer) = &consumer { - if let Some(mut cap) = cap.as_mut() { + if let Some(cap) = cap.as_mut() { activator.activate(); // we want to be re-scheduled // Poll kafka topic for control commands diff --git a/src/lib.rs b/src/lib.rs index 1a28c36..87f9284 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -126,8 +126,8 @@ impl LoadBalancer { let mut moves = Vec::new(); loop { - let max = self.worker2bins.iter().max_by_key(|(w, bins)| bins.len()).unwrap(); - let min = self.worker2bins.iter().min_by_key(|(w, bins)| bins.len()).unwrap(); + let max = self.worker2bins.iter().max_by_key(|(_w, bins)| bins.len()).unwrap(); + let min = self.worker2bins.iter().min_by_key(|(_w, bins)| bins.len()).unwrap(); let delta = max.1.len() - min.1.len(); if delta <= 1 { break } // we are done, work is balanced @@ -147,6 +147,7 @@ impl LoadBalancer { println!("map: {:?}", map); } + #[allow(dead_code)] fn verify(&self) { // self.dump_map(); // properly balanced @@ -161,12 +162,11 @@ impl LoadBalancer { } mod test { - use crate::LoadBalancer; #[test] fn load_balancer_init() { let workers = (0..6_usize).collect::>(); - let mut lb = LoadBalancer::new(workers, 50); + let mut lb = crate::LoadBalancer::new(workers, 50); lb.dump_map(); let new_workers = (6..60_usize).collect::>();