shahidki31 commented on a change in pull request #26378:
[SPARK-29724][SPARK-29726][WEBUI][SQL] Support JDBC/ODBC tab for HistoryServer
WebUI
URL: https://github.com/apache/spark/pull/26378#discussion_r351338194
##########
File path:
core/src/main/scala/org/apache/spark/deploy/history/FsHistoryProvider.scala
##########
@@ -352,17 +352,36 @@ private[history] class FsHistoryProvider(conf:
SparkConf, clock: Clock)
val ui = SparkUI.create(None, new HistoryAppStatusStore(conf, kvstore),
conf, secManager,
app.info.name, HistoryServer.getAttemptURI(appId,
attempt.info.attemptId),
attempt.info.startTime.getTime(), attempt.info.appSparkVersion)
- loadPlugins().foreach(_.setupUI(ui))
-
+ setupPluginUI(ui)
val loadedUI = LoadedAppUI(ui)
-
synchronized {
activeUIs((appId, attemptId)) = loadedUI
}
Some(loadedUI)
}
+ private def setupPluginUI(ui: SparkUI): Unit = {
+ val plugins = loadPlugins().toSeq
+
+ var sqlTab: Option[AppHistoryServerPlugin] = None
+ var jdbcTab: Option[AppHistoryServerPlugin] = None
+ val otherTabs: Seq[AppHistoryServerPlugin] = Seq()
+
+ plugins.foreach{ plugin =>
+ if (plugin.toString.contains("SQLHistoryServerPlugin")) {
Review comment:
@gengliangwang Another way could be, control the tab position based on the
class name
```
plugins.map { plugin =>
val splitPath: Array[String] = plugin.toString.split("\\.")
val className = splitPath(splitPath.length - 1)
(plugin, className)
}.sortBy(_._2).foreach(_._1.setupUI(ui))
```
Here, we just need to make sure, whatever tab need to come later, has
greater className than the previous one.
Here if I make class name as `ThriftServer2HistoryServerPlugin`, then it
will come at the end. But I am not sure, we need to make it complicated,
compare to the exisitng one, as long as we comment it properly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]