Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/7774#discussion_r36130736
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/ui/ExecutionPage.scala ---
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.ui
+
+import javax.servlet.http.HttpServletRequest
+
+import scala.xml.{Node, Unparsed}
+
+import org.apache.commons.lang3.StringEscapeUtils
+
+import org.apache.spark.Logging
+import org.apache.spark.ui.{UIUtils, WebUIPage}
+
+private[sql] class ExecutionPage(parent: SQLTab) extends
WebUIPage("execution") with Logging {
+
+ private val listener = parent.listener
+
+ override def render(request: HttpServletRequest): Seq[Node] =
listener.synchronized {
+ val parameterExecutionId = request.getParameter("id")
+ require(parameterExecutionId != null && parameterExecutionId.nonEmpty,
+ "Missing execution id parameter")
+
+ val executionId = parameterExecutionId.toLong
+ val content = listener.getExecution(executionId).map { executionUIData
=>
+ val currentTime = System.currentTimeMillis()
+ val duration =
+ executionUIData.completionTime.getOrElse(currentTime) -
executionUIData.submissionTime
+
+ val summary =
+ <div>
+ <ul class="unstyled">
+ <li>
+ <strong>Submitted Time:
</strong>{UIUtils.formatDate(executionUIData.submissionTime)}
+ </li>
+ <li>
+ <strong>Duration: </strong>{UIUtils.formatDuration(duration)}
+ </li>
+ {if (executionUIData.runningJobs.nonEmpty) {
+ <li>
+ <strong>Running Jobs: </strong>
+ {executionUIData.runningJobs.sorted.map { jobId =>
+ <a
href={jobURL(jobId)}>{jobId.toString}</a><span> </span>
+ }}
+ </li>
+ }}
+ {if (executionUIData.succeededJobs.nonEmpty) {
+ <li>
+ <strong>Succeeded Jobs: </strong>
+ {executionUIData.succeededJobs.sorted.map { jobId =>
+ <a
href={jobURL(jobId)}>{jobId.toString}</a><span> </span>
+ }}
+ </li>
+ }}
+ {if (executionUIData.failedJobs.nonEmpty) {
+ <li>
+ <strong>Failed Jobs: </strong>
+ {executionUIData.failedJobs.sorted.map { jobId =>
+ <a
href={jobURL(jobId)}>{jobId.toString}</a><span> </span>
+ }}
+ </li>
+ }}
+ <li>
+ <strong>Detail: </strong><br/>
+ <pre>{executionUIData.physicalPlanDescription}</pre>
+ </li>
+ </ul>
+ </div>
+
+ val metrics = listener.getExecutionMetrics(executionId)
+
+ summary ++ planVisualization(metrics,
executionUIData.physicalPlanGraph)
+ }.getOrElse {
+ <div>No information to display for Plan {executionId}</div>
+ }
+
+ UIUtils.headerSparkPage(s"Details for Query $executionId", content,
parent, Some(5000))
+ }
+
+
+ private def planVisualizationResources: Seq[Node] = {
+ // scalastyle:off
+ <link rel="stylesheet"
href={UIUtils.prependBaseUri("/static/sql/spark-sql-viz.css")} type="text/css"/>
+ <script src={UIUtils.prependBaseUri("/static/d3.min.js")}></script>
+ <script
src={UIUtils.prependBaseUri("/static/dagre-d3.min.js")}></script>
+ <script
src={UIUtils.prependBaseUri("/static/graphlib-dot.min.js")}></script>
+ <script
src={UIUtils.prependBaseUri("/static/sql/spark-sql-viz.js")}></script>
+ // scalastyle:on
+ }
+
+ private def planVisualization(metrics: Map[Long, Any], graph:
SparkPlanGraph): Seq[Node] = {
+ val metadata = graph.nodes.flatMap { node =>
+ val nodeId = s"plan-meta-data-${node.id}"
+
--- End diff --
kill empty line
---
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]