Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzSelv committed Aug 30, 2019
1 parent 43c1a9b commit 1eadced
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ authors = ["Lorenzo Selvatici <selvatici.lorenzo@gmail.com>"]
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"
Expand Down
2 changes: 1 addition & 1 deletion src/kafka.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub fn control_stream<G: Scope<Timestamp=usize>>(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
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -147,6 +147,7 @@ impl LoadBalancer {
println!("map: {:?}", map);
}

#[allow(dead_code)]
fn verify(&self) {
// self.dump_map();
// properly balanced
Expand All @@ -161,12 +162,11 @@ impl LoadBalancer {
}

mod test {
use crate::LoadBalancer;

#[test]
fn load_balancer_init() {
let workers = (0..6_usize).collect::<Vec<_>>();
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::<Vec<_>>();
Expand Down

0 comments on commit 1eadced

Please sign in to comment.