Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/1418#discussion_r15558011
  
    --- 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 --
    
    why define a function here? seems like this is only used once? why not just 
inline it in the while?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to