Skip to content

Commit

Permalink
remove inspect dbg stmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cdouglas committed Dec 13, 2023
1 parent 670b7d9 commit 9dea364
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions hydroflow/examples/dbsp/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,34 @@ pub fn main() {
-> map(|(id, x, n): (usize, usize, i32)| ((id, x), n))
-> fold_keyed::<'static, (usize, usize), i32>(|| 0, |old: &mut i32, n: i32| *old += n)
-> defer_tick()
-> inspect(|t| println!("T: {:?}", t))
//-> inspect(|t| println!("T: {:?}", t))
-> map(|((id, x), n)| (id, (x, n)))
-> [0]t_join;
// count unique relational tuples from dR, generate tuples with multiplicities
R = dR
-> map(|(id, y, m): (usize, usize, i32)| ((id, y), m))
-> fold_keyed::<'static, (usize, usize), i32>(|| 0i32, |old: &mut i32, m: i32| *old += m)
-> defer_tick()
-> inspect(|t| println!("R: {:?}", t))
//-> inspect(|t| println!("R: {:?}", t))
-> map(|((id, y), m)| (id, (y, m)))
-> [1]r_join;

// ΔT × ΔR
dT -> map(|(id, x, n)| (id, (x, n))) -> [0]diffjoin;
dR -> map(|(id, y, m)| (id, (y, m))) -> [1]diffjoin;
diffjoin = join()
-> inspect(|t| println!("d_join: {:?}", t))
//-> inspect(|t| println!("d_join: {:?}", t))
-> o_stream;
// T × ΔR
dR -> map(|(id, y, m)| (id, (y, m))) -> [1]t_join;
t_join = join()
-> inspect(|t| println!("t_join: {:?}", t))
//-> inspect(|t| println!("t_join: {:?}", t))
-> o_stream;

// ΔT × R
dT -> map(|(k, x, n)| (k, (x, n))) -> [0]r_join;
r_join = join()
-> inspect(|t| println!("r_join: {:?}", t))
//-> inspect(|t| println!("r_join: {:?}", t))
-> o_stream;

// ΔT × ΔR + ΔT × R + T × ΔR ; new tuples from ΔT, ΔR
Expand All @@ -78,10 +78,10 @@ pub fn main() {
// send to output if this tuple was not in last_output
o_stream
-> map(|(id, x, y, m)| ((id, x, y), m))
-> inspect(|t| println!("ostream: {:?}", t))
//-> inspect(|t| println!("ostream: {:?}", t))
-> [0]loj;
last_stream
-> inspect(|t| println!("last_stream: {:?}", t))
//-> inspect(|t| println!("last_stream: {:?}", t))
//-> map(|(id, x, y, m)| ((id, x, y), m))
-> [1]loj;
loj = import!("left_outer_join.hf"); // ((id, x, y), (m1, m2))
Expand Down Expand Up @@ -126,13 +126,18 @@ pub fn main() {

println!("\nStart tick 3");

R_send.send(((0, 9, 10), -2)).unwrap();
R_send.send(((0, 9, 10), -1)).unwrap();
R_send.send(((1, 0, 1), 1)).unwrap();
T_send.send(((0, 5, 6), 1)).unwrap();
T_send.send(((1, 0, 1), 1)).unwrap();
df.run_tick();

println!("End tick 3");
println!("\nStart tick 4");
R_send.send(((0, 9, 10), -1)).unwrap();
R_send.send(((1, 0, 1), 1)).unwrap();
T_send.send(((0, 5, 6), 1)).unwrap();
T_send.send(((1, 0, 1), 1)).unwrap();
df.run_tick();

// Nothing here...
//df.run_tick();
Expand Down

0 comments on commit 9dea364

Please sign in to comment.