Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/1418#discussion_r15590707
--- Diff: core/src/main/scala/org/apache/spark/scheduler/DAGScheduler.scala
---
@@ -275,18 +286,51 @@ class DAGScheduler(
case shufDep: ShuffleDependency[_, _, _] =>
parents += getShuffleMapStage(shufDep, jobId)
case _ =>
- visit(dep.rdd)
+ waitingForVisit.push(dep.rdd)
}
}
}
}
- visit(rdd)
+ waitingForVisit.push(rdd)
+ while (!waitingForVisit.isEmpty) {
+ visit(waitingForVisit.pop())
+ }
parents.toList
}
+ private def getParentShuffleDependencies(rdd: RDD[_]):
Stack[ShuffleDependency[_, _, _]] = {
+ val parents = new Stack[ShuffleDependency[_, _, _]]
+ val visited = new HashSet[RDD[_]]
+ val waitingForVisit = new Stack[RDD[_]]
+ def visit(r: RDD[_]) {
--- End diff --
I let the codes as the function `getParentShuffleDependencies` because it
contains multiple indents and so put it under the `case` statement would not be
readable. I can make it as inline if this is an issue.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---