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

Feature/add storm dot graph #236

Merged
merged 17 commits into from
Sep 22, 2013
Merged

Feature/add storm dot graph #236

merged 17 commits into from
Sep 22, 2013

Conversation

ianoc
Copy link
Collaborator

@ianoc ianoc commented Sep 20, 2013

Adds the concept of a Planned DAG for storm jobs that can be emitted as a graphviz

Adds a series of laws for this DAG

}
}

object StormToplogyBuilder {
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo

@ianoc
Copy link
Collaborator Author

ianoc commented Sep 20, 2013

failinggraph42 dot
failinggraph36 dot

some samples of generated graphs

@sritchie
Copy link
Collaborator

Such a dominator!

collectProducers(producer, updatedBolt, updatedDag, forkedNodes, visited = visited)
}

def resolve(dependency: Prod[_]): Prod[_] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

add comment here to explain it more.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Change to boolean: mergeableWithSource()?

Add law saying no flat maps can live with a source
Adds extra handling in graph to ensure we don't push flat mapped producers down to the source
Rename forward/reverse to dependsOn and dependantOf for clarity
Add comments for maybeCollapse and maybeSplit
…hose producers aren't normal merges.

Add in a block to disallow a source to be both sides of a merge(or indeed any other node).

Fix generator so this doesn't occur.

Clean up and encapsulate in a private class more of the separation logic
@ianoc
Copy link
Collaborator Author

ianoc commented Sep 21, 2013

Updated to fix an edge case where the MergeProducer that was being depended on by another MergeProducer was a fan out node and so couldn't be collapsed down. Also where the visited nodes having been seen was causing some StormNodes not to be registered

@ianoc
Copy link
Collaborator Author

ianoc commented Sep 21, 2013

@johnynek , @sritchie The mega graphs its making now:

Though note the nodes which are just IdentityKeyedProducer and MergedProducers
failinggraph5433 dot


package com.twitter.summingbird.storm

import backtype.storm.LocalCluster
Copy link
Collaborator

Choose a reason for hiding this comment

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

are any of these used? (storm imports)?

Can you audit and remove anything unnneed? It will make it easier to think of using this on other platforms.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed nearly all imports

private type Prod[T] = Producer[Storm, T]
private type VisitedStore = Set[Prod[_]]

def apply[P](tail: Producer[Storm, P]): StormDag = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is weird that you have two apply methods that return two different types. They should either be renamed, or return one type.

For apply, I think it works for Function-like objects (one return type), or constructor-like methods (return an instance of the trait or class that the object is a companion of).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wait, got cusfused by the inner class with a lowercase name.

@ianoc
Copy link
Collaborator Author

ianoc commented Sep 21, 2013

passed, should be ready to look at changes

// Producers which live in the same node will result in a NOP in connect.
stormNode.members.foldLeft(curDag) { (innerDag, dependantProducer) =>
dependantProducer match {
case Summer(producer, _, _) => innerDag.connect(producer, dependantProducer)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not:

Producer
  .dependenciesOf(dependantProducer)
  .foldLeft(innerDag) { {dag, dep) => dag.connect(dep, dependantProducer) }

Would that work and save some code duplication with dependenciesOf?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's address this, if you agree in a next PR.

johnynek added a commit that referenced this pull request Sep 22, 2013
@johnynek johnynek merged commit 2f1a453 into develop Sep 22, 2013
@johnynek johnynek deleted the feature/add_storm_dot_graph branch September 22, 2013 17:54
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