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

Add doc comments for Dag and minor reformatting. #683

Closed
wants to merge 7 commits into from

Conversation

pankajroark
Copy link
Contributor

No description provided.

dependenciesOfM: Map[Node[P], List[Node[P]]] = Map[Node[P], List[Node[P]]](),
dependantsOfM: Map[Node[P], List[Node[P]]] = Map[Node[P], List[Node[P]]]()) {
/**
* Summingbird converts a Directed Acyclic Graph(DAG) of Producers into a DAG of Nodes.
Copy link
Contributor

Choose a reason for hiding this comment

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

It's probably worth calling out that Dag objects aren't (typically) constructed directly, but rather through the companion object helpers, which also generate (long) names for each Node.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, added that.

* @param producerToPriorityNames Map every producer to list of names that apply to it.
* These are the names provided by named nodes.
* e.g. .name("mynode"). Names flow backwards, i.e from
* source to tail.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you clarify the "Names flow backwards, from source to tail" - Actually I think that a Source inherits the name from the Tail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right I got it reversed, fixed.

@@ -91,20 +91,19 @@ case class SourceNode[P <: Platform[P]](override val members: List[Producer[P, _
* @param originalTail The TailProducer before stripping out named nodes.
* @param producerToPriorityNames Map every producer to list of names that apply to it.
* These are the names provided by named nodes.
* e.g. .name("mynode"). Names flow backwards, i.e from
* source to tail.
* e.g. .name("mynode"). Names flow from tail to source.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also call out that the nearest name takes the priority.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, done.

* @param producerToNode What node does a producer map to. Many producers can
* map into a single node.
* @param producerToNode Maps producer to node. Many producers can map into a
* single node.
* @param nodes All nodes covered by this Dag.
* @param nodeToName Summingbird assigns a unique name to every node. This
* is that mapping. Note that this name is different from
* the name used for applying named options.
Copy link
Contributor

Choose a reason for hiding this comment

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

"This is that mapping" - can you remove it and rephrase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

* other words, what are the parents of this node.
* @param dependantsOfM What nodes immediately depend on the given node. In
* other words what are the children of this node.
* @param dependenciesOfM Nodes this node immediately depends on. In other words,
Copy link
Contributor

Choose a reason for hiding this comment

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

"Nodes this node immediately depends on" - rephrase

@johnynek
Copy link
Collaborator

seems like a good improvement to style and documentation.

you might contrast this to the code in https://github.com/twitter/summingbird/tree/develop/summingbird-core/src/main/scala/com/twitter/summingbird/graph
which are utilities on generic graphs, which we use to inspect the producer graph generally (like to reverse the graph to see downstream dependencies).

@pankajroark
Copy link
Contributor Author

@johnynek Thanks for pointing out docs for other graph utilities. While reading Dag optimization related code I came across several places where I felt documentation would have been really useful and expected it. I'm trying to add docs to those places, will likely send many more such PRs. Let me know when it feels I'm going overboard :).
Can I consider your previous comment a thumbs up? Praneeth already reviewed it and I'm ready to merge it.

@johnynek
Copy link
Collaborator

👍

@pankajroark
Copy link
Contributor Author

Merged from command line, since I needed to squash commits.

@johnynek
Copy link
Collaborator

note that github can do squash commits now. After you click the merge
button you can select squash.

On Thu, Aug 18, 2016 at 8:52 AM, Pankaj Gupta notifications@github.com
wrote:

Merged from command line, since I needed to squash commits.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#683 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEJdlew004yIrlgVpHdCBoWR4YjMF4Tks5qhKn1gaJpZM4Jm8do
.

P. Oscar Boykin, Ph.D. | http://twitter.com/posco | http://pobox.com/~boykin

@pankajroark
Copy link
Contributor Author

Ahh... didn't know that merge button gives squash option. Will do that from next time.

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.

4 participants