samra-h commented on code in PR #58965:
URL: https://github.com/apache/spark/pull/58965#discussion_r4498544187
##########
core/src/main/scala/org/apache/spark/status/AppHistoryServerPlugin.scala:
##########
@@ -36,8 +41,25 @@ private[spark] trait AppHistoryServerPlugin {
*/
def setupUI(ui: SparkUI): Unit
+ /**
+ * Static resources (JS/CSS bundled with the plugin) to serve from the
History Server's own UI,
+ * as (classpath resource directory, URL path) pairs. They are registered
once at startup.
+ * Unlike a handler attached in [[setupUI]], which is torn down when the
application cache
+ * evicts that application, these live as long as the History Server.
+ *
+ * This does not replace the registration in [[setupUI]] or in the tabs: the
live driver UI
+ * never calls this hook, so tabs must still register their own handlers.
+ */
+ def staticResources: Seq[(String, String)] = Nil
+
/**
* The position of a plugin tab relative to the other plugin tabs in the
history UI.
*/
def displayOrder: Int = Integer.MAX_VALUE
}
+
+private[spark] object AppHistoryServerPlugin {
+ def loadPlugins(): Iterable[AppHistoryServerPlugin] = {
Review Comment:
Moved the loop into AppHistoryServerPlugin.skipUnloadable, and loadPlugins()
now returns a Seq of the plugins that loaded.
I kept a small fake iterator for the two load-failure tests (a plugin that
fails to load, and an iterator that keeps failing without moving on). Doing it
with a real ServiceLoader would need a services
file on the test class path with a broken provider. A static file might
affect other core suites, and a dynamic one needs a custom class loader and
public top-level test plugin classes.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]