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

    https://github.com/apache/spark/pull/6839#discussion_r32513428
  
    --- Diff: 
core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala ---
    @@ -70,6 +70,16 @@ private[ui] class RDDOperationCluster(val id: String, 
private var _name: String)
       def getAllNodes: Seq[RDDOperationNode] = {
         _childNodes ++ _childClusters.flatMap(_.childNodes)
       }
    +
    +  /** Return all the node which are cached. */
    +  def getCachedNode: Seq[RDDOperationNode] = {
    +    var cachedNodes = new ListBuffer[RDDOperationNode]
    --- End diff --
    
    Can be a `val`, and can add the initial elements straight away with just 
`ListBuffer(cachedNodes:_*)`. Below you have a missing space before `for`, but 
better than a `for` loop, why not
    
    ```
    _childClusters.foreach(cluster => cachedNodes ++= 
cluster._childNodes.filter(_.cached))
    ```
    ? Unless I overlook something that works.
    
    Also, can you explain why you think this is slow to begin with? because 
nodes are expanded, then filtered?
    
    Your JIRAs have been missing this so please add clearer motivation.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to