Skip to content
This repository was archived by the owner on Jan 20, 2022. It is now read-only.

Add dot graph generation from a summing bird graph.#223

Merged
johnynek merged 3 commits intodevelopfrom
feature/add_dot_graph
Sep 18, 2013
Merged

Add dot graph generation from a summing bird graph.#223
johnynek merged 3 commits intodevelopfrom
feature/add_dot_graph

Conversation

@ianoc
Copy link
Copy Markdown
Contributor

@ianoc ianoc commented Sep 18, 2013

Use with
import com.twitter.summingbird.viz.BaseViz

val writer = new PrintWriter(new File("/tmp/output.dot"))

BaseViz(node, writer)
writer.close()

Use with
  import com.twitter.summingbird.viz.BaseViz

    val writer = new PrintWriter(new File("/tmp/output.dot"))
  BaseViz(node, writer)
    writer.close()
@sritchie
Copy link
Copy Markdown

Nice! Can you paste in some example output for some graph?

@ianoc
Copy link
Copy Markdown
Contributor Author

ianoc commented Sep 18, 2013

graph:

Storm.source(Spout.fromTraversable(Seq(1, 2, 3, 4))).name("Source from a sequence")
.flatMap {
i => List(i, i, i)
}.name("Increase stream size by outputting copies")
.map( _ -> 1L ).name("Convert to tuple")
.sumByKey(MergeableStoreSupplier.from {
MergeableStore.fromStore(Int, BatchID), Long
}).name("Group by, sum and store to JMap")

Dot graph produced:

graph summingbirdGraph {
"Increase stream size by outputting copies" -- "Convert to tuple"
"Convert to tuple" -- "Group by, sum and store to JMap"
"Source from a sequence" -- "Increase stream size by outputting copies"

}

@ianoc
Copy link
Copy Markdown
Contributor Author

ianoc commented Sep 18, 2013

output

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not crazy about this. We already have the get method, can you just expose the keys?

def nodes: Set[Producer[P, _]] = graph.keys

Add a nodes function to return the set of keys in the Dependants graph.
… from a local variable to using a dependentState variable with the nodes and getDependantsOf accessors.
@ianoc
Copy link
Copy Markdown
Contributor Author

ianoc commented Sep 18, 2013

Updated to reflect @johnynek 's comments

johnynek added a commit that referenced this pull request Sep 18, 2013
Add dot graph generation from a summing bird graph.
@johnynek johnynek merged commit bf69038 into develop Sep 18, 2013
@johnynek johnynek deleted the feature/add_dot_graph branch September 18, 2013 19:44
snoble pushed a commit to snoble/summingbird that referenced this pull request Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants