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

    https://github.com/apache/spark/pull/7602#discussion_r36017570
  
    --- Diff: 
core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala ---
    @@ -181,17 +181,18 @@ private[ui] object RDDOperationGraph extends Logging {
       }
     
       /** Return the dot representation of a subgraph in an RDDOperationGraph. 
*/
    -  private def makeDotSubgraph(cluster: RDDOperationCluster, indent: 
String): String = {
    -    val subgraph = new StringBuilder
    -    subgraph.append(indent + s"subgraph cluster${cluster.id} {\n")
    -    subgraph.append(indent + s"""  label="${cluster.name}";\n""")
    +  private def makeDotSubgraph(
    +    subgraph: StringBuilder,
    +    cluster: RDDOperationCluster,
    +    indent: String): StringBuilder = {
    +    subgraph.append(indent).append(s"subgraph cluster${cluster.id} {\n")
    +    subgraph.append(indent).append( s"""  label="${cluster.name}";\n""")
         cluster.childNodes.foreach { node =>
    -      subgraph.append(indent + s"  ${makeDotNode(node)};\n")
    +      subgraph.append(indent).append(s"  ${makeDotNode(node)};\n")
         }
         cluster.childClusters.foreach { cscope =>
    -      subgraph.append(makeDotSubgraph(cscope, indent + "  "))
    +      subgraph.append(makeDotSubgraph(subgraph, cscope, indent + "  "))
    --- End diff --
    
    You don't need to append the result of `makeDotSubgraph` right? it's 
already appending to the `StringBuilder`. I think to avoid this, it could be 
better to not return the `StringBuilder` at all.
    
    Otherwise yeah looking good. This probably helps to some degree.


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