-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hydroflow): add
repeat_n()
windowing operator, modify scheduler
- Loading branch information
1 parent
46333df
commit d973a9b
Showing
11 changed files
with
302 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
hydroflow/tests/snapshots/surface_loop__flo_repeat_n@graphvis_dot.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
source: hydroflow/tests/surface_loop.rs | ||
expression: "df.meta_graph().unwrap().to_dot(& Default :: default())" | ||
--- | ||
digraph { | ||
node [fontname="Monaco,Menlo,Consolas,"Droid Sans Mono",Inconsolata,"Courier New",monospace", style=filled]; | ||
edge [fontname="Monaco,Menlo,Consolas,"Droid Sans Mono",Inconsolata,"Courier New",monospace"]; | ||
n1v1 [label="(n1v1) source_iter([\"alice\", \"bob\"])", shape=invhouse, fillcolor="#88aaff"] | ||
n2v1 [label="(n2v1) source_stream(iter_batches_stream(0..12, 3))", shape=invhouse, fillcolor="#88aaff"] | ||
n3v1 [label="(n3v1) batch()", shape=invhouse, fillcolor="#88aaff"] | ||
n4v1 [label="(n4v1) flatten()", shape=invhouse, fillcolor="#88aaff"] | ||
n5v1 [label="(n5v1) batch()", shape=invhouse, fillcolor="#88aaff"] | ||
n6v1 [label="(n6v1) flatten()", shape=invhouse, fillcolor="#88aaff"] | ||
n7v1 [label="(n7v1) cross_join::<'static, 'tick>()", shape=invhouse, fillcolor="#88aaff"] | ||
n8v1 [label="(n8v1) repeat_n(3)", shape=invhouse, fillcolor="#88aaff"] | ||
n9v1 [label="(n9v1) map(|vec| (context.current_tick().0, vec))", shape=invhouse, fillcolor="#88aaff"] | ||
n10v1 [label="(n10v1) assert_eq([\l (\l 0,\l vec![\l (\"alice\", 0),\l (\"alice\", 1),\l (\"alice\", 2),\l (\"bob\", 0),\l (\"bob\", 1),\l (\"bob\", 2),\l ],\l ),\l (\l 0,\l vec![\l (\"alice\", 0),\l (\"alice\", 1),\l (\"alice\", 2),\l (\"bob\", 0),\l (\"bob\", 1),\l (\"bob\", 2),\l ],\l ),\l (\l 0,\l vec![\l (\"alice\", 0),\l (\"alice\", 1),\l (\"alice\", 2),\l (\"bob\", 0),\l (\"bob\", 1),\l (\"bob\", 2),\l ],\l ),\l (\l 1,\l vec![\l (\"alice\", 3),\l (\"alice\", 4),\l (\"alice\", 5),\l (\"bob\", 3),\l (\"bob\", 4),\l (\"bob\", 5),\l ],\l ),\l (\l 1,\l vec![\l (\"alice\", 3),\l (\"alice\", 4),\l (\"alice\", 5),\l (\"bob\", 3),\l (\"bob\", 4),\l (\"bob\", 5),\l ],\l ),\l (\l 1,\l vec![\l (\"alice\", 3),\l (\"alice\", 4),\l (\"alice\", 5),\l (\"bob\", 3),\l (\"bob\", 4),\l (\"bob\", 5),\l ],\l ),\l (\l 2,\l vec![\l (\"alice\", 6),\l (\"alice\", 7),\l (\"alice\", 8),\l (\"bob\", 6),\l (\"bob\", 7),\l (\"bob\", 8),\l ],\l ),\l (\l 2,\l vec![\l (\"alice\", 6),\l (\"alice\", 7),\l (\"alice\", 8),\l (\"bob\", 6),\l (\"bob\", 7),\l (\"bob\", 8),\l ],\l ),\l (\l 2,\l vec![\l (\"alice\", 6),\l (\"alice\", 7),\l (\"alice\", 8),\l (\"bob\", 6),\l (\"bob\", 7),\l (\"bob\", 8),\l ],\l ),\l (\l 3,\l vec![\l (\"alice\", 9),\l (\"alice\", 10),\l (\"alice\", 11),\l (\"bob\", 9),\l (\"bob\", 10),\l (\"bob\", 11),\l ],\l ),\l (\l 3,\l vec![\l (\"alice\", 9),\l (\"alice\", 10),\l (\"alice\", 11),\l (\"bob\", 9),\l (\"bob\", 10),\l (\"bob\", 11),\l ],\l ),\l (\l 3,\l vec![\l (\"alice\", 9),\l (\"alice\", 10),\l (\"alice\", 11),\l (\"bob\", 9),\l (\"bob\", 10),\l (\"bob\", 11),\l ],\l ),\l])\l", shape=house, fillcolor="#ffff88"] | ||
n11v1 [label="(n11v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n12v1 [label="(n12v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n13v1 [label="(n13v1) handoff", shape=parallelogram, fillcolor="#ddddff"] | ||
n4v1 -> n7v1 [label="0"] | ||
n3v1 -> n4v1 | ||
n1v1 -> n11v1 | ||
n6v1 -> n7v1 [label="1"] | ||
n5v1 -> n6v1 | ||
n2v1 -> n12v1 | ||
n9v1 -> n10v1 | ||
n8v1 -> n9v1 | ||
n7v1 -> n13v1 | ||
n11v1 -> n3v1 | ||
n12v1 -> n5v1 | ||
n13v1 -> n8v1 [color=red] | ||
subgraph "cluster n1v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_1v1\nstratum 0" | ||
n1v1 | ||
subgraph "cluster_sg_1v1_var_users" { | ||
label="var users" | ||
n1v1 | ||
} | ||
} | ||
subgraph "cluster n2v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_2v1\nstratum 0" | ||
n2v1 | ||
subgraph "cluster_sg_2v1_var_messages" { | ||
label="var messages" | ||
n2v1 | ||
} | ||
} | ||
subgraph "cluster n3v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_3v1\nstratum 0" | ||
n3v1 | ||
n4v1 | ||
n5v1 | ||
n6v1 | ||
n7v1 | ||
subgraph "cluster_sg_3v1_var_cp" { | ||
label="var cp" | ||
n7v1 | ||
} | ||
} | ||
subgraph "cluster n4v1" { | ||
fillcolor="#dddddd" | ||
style=filled | ||
label = "sg_4v1\nstratum 1" | ||
n8v1 | ||
n9v1 | ||
n10v1 | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
hydroflow/tests/snapshots/surface_loop__flo_repeat_n@graphvis_mermaid.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
source: hydroflow/tests/surface_loop.rs | ||
expression: "df.meta_graph().unwrap().to_mermaid(& Default :: default())" | ||
--- | ||
%%{init:{'theme':'base','themeVariables':{'clusterBkg':'#ddd','clusterBorder':'#888'}}}%% | ||
flowchart TD | ||
classDef pullClass fill:#8af,stroke:#000,text-align:left,white-space:pre | ||
classDef pushClass fill:#ff8,stroke:#000,text-align:left,white-space:pre | ||
classDef otherClass fill:#fdc,stroke:#000,text-align:left,white-space:pre | ||
linkStyle default stroke:#aaa | ||
1v1[\"(1v1) <code>source_iter(["alice", "bob"])</code>"/]:::pullClass | ||
2v1[\"(2v1) <code>source_stream(iter_batches_stream(0..12, 3))</code>"/]:::pullClass | ||
3v1[\"(3v1) <code>batch()</code>"/]:::pullClass | ||
4v1[\"(4v1) <code>flatten()</code>"/]:::pullClass | ||
5v1[\"(5v1) <code>batch()</code>"/]:::pullClass | ||
6v1[\"(6v1) <code>flatten()</code>"/]:::pullClass | ||
7v1[\"(7v1) <code>cross_join::<'static, 'tick>()</code>"/]:::pullClass | ||
8v1[\"(8v1) <code>repeat_n(3)</code>"/]:::pullClass | ||
9v1[\"(9v1) <code>map(|vec| (context.current_tick().0, vec))</code>"/]:::pullClass | ||
10v1[/"<div style=text-align:center>(10v1)</div> <code>assert_eq([<br> (<br> 0,<br> vec![<br> ("alice", 0),<br> ("alice", 1),<br> ("alice", 2),<br> ("bob", 0),<br> ("bob", 1),<br> ("bob", 2),<br> ],<br> ),<br> (<br> 0,<br> vec![<br> ("alice", 0),<br> ("alice", 1),<br> ("alice", 2),<br> ("bob", 0),<br> ("bob", 1),<br> ("bob", 2),<br> ],<br> ),<br> (<br> 0,<br> vec![<br> ("alice", 0),<br> ("alice", 1),<br> ("alice", 2),<br> ("bob", 0),<br> ("bob", 1),<br> ("bob", 2),<br> ],<br> ),<br> (<br> 1,<br> vec![<br> ("alice", 3),<br> ("alice", 4),<br> ("alice", 5),<br> ("bob", 3),<br> ("bob", 4),<br> ("bob", 5),<br> ],<br> ),<br> (<br> 1,<br> vec![<br> ("alice", 3),<br> ("alice", 4),<br> ("alice", 5),<br> ("bob", 3),<br> ("bob", 4),<br> ("bob", 5),<br> ],<br> ),<br> (<br> 1,<br> vec![<br> ("alice", 3),<br> ("alice", 4),<br> ("alice", 5),<br> ("bob", 3),<br> ("bob", 4),<br> ("bob", 5),<br> ],<br> ),<br> (<br> 2,<br> vec![<br> ("alice", 6),<br> ("alice", 7),<br> ("alice", 8),<br> ("bob", 6),<br> ("bob", 7),<br> ("bob", 8),<br> ],<br> ),<br> (<br> 2,<br> vec![<br> ("alice", 6),<br> ("alice", 7),<br> ("alice", 8),<br> ("bob", 6),<br> ("bob", 7),<br> ("bob", 8),<br> ],<br> ),<br> (<br> 2,<br> vec![<br> ("alice", 6),<br> ("alice", 7),<br> ("alice", 8),<br> ("bob", 6),<br> ("bob", 7),<br> ("bob", 8),<br> ],<br> ),<br> (<br> 3,<br> vec![<br> ("alice", 9),<br> ("alice", 10),<br> ("alice", 11),<br> ("bob", 9),<br> ("bob", 10),<br> ("bob", 11),<br> ],<br> ),<br> (<br> 3,<br> vec![<br> ("alice", 9),<br> ("alice", 10),<br> ("alice", 11),<br> ("bob", 9),<br> ("bob", 10),<br> ("bob", 11),<br> ],<br> ),<br> (<br> 3,<br> vec![<br> ("alice", 9),<br> ("alice", 10),<br> ("alice", 11),<br> ("bob", 9),<br> ("bob", 10),<br> ("bob", 11),<br> ],<br> ),<br>])</code>"\]:::pushClass | ||
11v1["(11v1) <code>handoff</code>"]:::otherClass | ||
12v1["(12v1) <code>handoff</code>"]:::otherClass | ||
13v1["(13v1) <code>handoff</code>"]:::otherClass | ||
4v1-->|0|7v1 | ||
3v1-->4v1 | ||
1v1-->11v1 | ||
6v1-->|1|7v1 | ||
5v1-->6v1 | ||
2v1-->12v1 | ||
9v1-->10v1 | ||
8v1-->9v1 | ||
7v1-->13v1 | ||
11v1-->3v1 | ||
12v1-->5v1 | ||
13v1--x8v1; linkStyle 11 stroke:red | ||
subgraph sg_1v1 ["sg_1v1 stratum 0"] | ||
1v1 | ||
subgraph sg_1v1_var_users ["var <tt>users</tt>"] | ||
1v1 | ||
end | ||
end | ||
subgraph sg_2v1 ["sg_2v1 stratum 0"] | ||
2v1 | ||
subgraph sg_2v1_var_messages ["var <tt>messages</tt>"] | ||
2v1 | ||
end | ||
end | ||
subgraph sg_3v1 ["sg_3v1 stratum 0"] | ||
3v1 | ||
4v1 | ||
5v1 | ||
6v1 | ||
7v1 | ||
subgraph sg_3v1_var_cp ["var <tt>cp</tt>"] | ||
7v1 | ||
end | ||
end | ||
subgraph sg_4v1 ["sg_4v1 stratum 1"] | ||
8v1 | ||
9v1 | ||
10v1 | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.