Skip to content

Commit

Permalink
[SPARK-29019] Move tooltips to thrift server module
Browse files Browse the repository at this point in the history
  • Loading branch information
planga82 committed Sep 26, 2019
1 parent 6474935 commit 1bb6196
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
12 changes: 0 additions & 12 deletions core/src/main/scala/org/apache/spark/ui/ToolTips.scala
Expand Up @@ -99,16 +99,4 @@ private[spark] object ToolTips {
dynamic allocation is enabled. The number of granted executors may exceed the limit
ephemerally when executors are being killed.
"""

val THRIFT_SERVER_FINISH_TIME =
"Execution finish time, before fetching the results"

val THRIFT_SERVER_CLOSE_TIME =
"Operation close time after fetching the results"

val THRIFT_SERVER_EXECUTION =
"Difference between start time and finish time"

val THRIFT_SERVER_DURATION =
"Difference between start time and close time"
}
Expand Up @@ -28,6 +28,7 @@ import org.apache.spark.internal.Logging
import org.apache.spark.sql.hive.thriftserver.HiveThriftServer2.{ExecutionInfo, ExecutionState, SessionInfo}
import org.apache.spark.ui._
import org.apache.spark.ui.UIUtils._
import org.apache.spark.sql.hive.thriftserver.ui.ToolTips._


/** Page for Spark Web UI that shows statistics of the thrift server */
Expand Down Expand Up @@ -72,9 +73,9 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage(""
val table = if (numStatement > 0) {
val headerRow = Seq("User", "JobID", "GroupID", "Start Time", "Finish Time", "Close Time",
"Execution Time", "Duration", "Statement", "State", "Detail")
val tooltips = Seq(None, None, None, None, Some(ToolTips.THRIFT_SERVER_FINISH_TIME),
Some(ToolTips.THRIFT_SERVER_CLOSE_TIME), Some(ToolTips.THRIFT_SERVER_EXECUTION),
Some(ToolTips.THRIFT_SERVER_DURATION), None, None, None)
val tooltips = Seq(None, None, None, None, Some(THRIFT_SERVER_FINISH_TIME),
Some(THRIFT_SERVER_CLOSE_TIME), Some(THRIFT_SERVER_EXECUTION),
Some(THRIFT_SERVER_DURATION), None, None, None)
assert(headerRow.length == tooltips.length)
val dataRows = listener.getExecutionList.sortBy(_.startTimestamp).reverse

Expand Down
Expand Up @@ -28,6 +28,7 @@ import org.apache.spark.internal.Logging
import org.apache.spark.sql.hive.thriftserver.HiveThriftServer2.{ExecutionInfo, ExecutionState}
import org.apache.spark.ui._
import org.apache.spark.ui.UIUtils._
import org.apache.spark.sql.hive.thriftserver.ui.ToolTips._

/** Page for Spark Web UI that shows statistics of jobs running in the thrift server */
private[ui] class ThriftServerSessionPage(parent: ThriftServerTab)
Expand Down Expand Up @@ -81,9 +82,9 @@ private[ui] class ThriftServerSessionPage(parent: ThriftServerTab)
val table = if (numStatement > 0) {
val headerRow = Seq("User", "JobID", "GroupID", "Start Time", "Finish Time", "Close Time",
"Execution Time", "Duration", "Statement", "State", "Detail")
val tooltips = Seq(None, None, None, None, Some(ToolTips.THRIFT_SERVER_FINISH_TIME),
Some(ToolTips.THRIFT_SERVER_CLOSE_TIME), Some(ToolTips.THRIFT_SERVER_EXECUTION),
Some(ToolTips.THRIFT_SERVER_DURATION), None, None, None)
val tooltips = Seq(None, None, None, None, Some(THRIFT_SERVER_FINISH_TIME),
Some(THRIFT_SERVER_CLOSE_TIME), Some(THRIFT_SERVER_EXECUTION),
Some(THRIFT_SERVER_DURATION), None, None, None)
assert(headerRow.length == tooltips.length)
val dataRows = executionList.sortBy(_.startTimestamp).reverse

Expand Down
@@ -0,0 +1,32 @@
/*
* 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.hive.thriftserver.ui

private[ui] object ToolTips {
val THRIFT_SERVER_FINISH_TIME =
"Execution finish time, before fetching the results"

val THRIFT_SERVER_CLOSE_TIME =
"Operation close time after fetching the results"

val THRIFT_SERVER_EXECUTION =
"Difference between start time and finish time"

val THRIFT_SERVER_DURATION =
"Difference between start time and close time"
}

0 comments on commit 1bb6196

Please sign in to comment.