@@ -36,47 +36,15 @@ private[ui] class VisualizationListener(conf: SparkConf) extends SparkListener {
36
36
private val retainedStages =
37
37
conf.getInt(" spark.ui.retainedStages" , SparkUI .DEFAULT_RETAINED_STAGES )
38
38
39
- /** Construct a "DAG visualization" DOM element that expands into a visualization for a stage. */
40
- def showVizElementForStage (stageId : Int ): Seq [Node ] = {
41
- showVizElement(getVizGraphForStage(stageId).toSeq, forJob = false )
42
- }
43
-
44
- /** Construct a "DAG visualization" DOM element that expands into a visualization for a job. */
45
- def showVizElementForJob (jobId : Int ): Seq [Node ] = {
46
- showVizElement(getVizGraphsForJob(jobId), forJob = true )
47
- }
48
-
49
- /** Construct a "DAG visualization" DOM element that expands into a visualization on the UI. */
50
- private def showVizElement (graphs : Seq [VizGraph ], forJob : Boolean ): Seq [Node ] = {
51
- <div >
52
- <span class =" expand-dag-viz" onclick ={s " toggleDagViz( $forJob); " }>
53
- <span class =" expand-dag-viz-arrow arrow-closed" ></span >
54
- <strong >DAG visualization</strong >
55
- </span >
56
- <div id =" dag-viz-graph" ></div >
57
- <div id =" dag-viz-metadata" >
58
- {
59
- graphs.map { g =>
60
- <div class =" stage-metadata" stageId ={g.rootScope.id} style =" display:none" >
61
- <div class =" dot-file" >{VizGraph .makeDotFile(g, forJob)}</div >
62
- { g.incomingEdges.map { e => <div class =" incoming-edge" >{e.fromId},{e.toId}</div > } }
63
- { g.outgoingEdges.map { e => <div class =" outgoing-edge" >{e.fromId},{e.toId}</div > } }
64
- </div >
65
- }
66
- }
67
- </div >
68
- </div >
69
- }
70
-
71
39
/** Return the graph metadata for the given stage, or None if no such information exists. */
72
- private def getVizGraphsForJob (jobId : Int ): Seq [VizGraph ] = {
40
+ def getVizGraphsForJob (jobId : Int ): Seq [VizGraph ] = {
73
41
jobIdToStageIds.get(jobId)
74
42
.map { sids => sids.flatMap { sid => stageIdToGraph.get(sid) } }
75
43
.getOrElse { Seq .empty }
76
44
}
77
45
78
46
/** Return the graph metadata for the given stage, or None if no such information exists. */
79
- private def getVizGraphForStage (stageId : Int ): Option [VizGraph ] = {
47
+ def getVizGraphForStage (stageId : Int ): Option [VizGraph ] = {
80
48
stageIdToGraph.get(stageId)
81
49
}
82
50
0 commit comments