aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorMarcelo Vanzin <vanzin@cloudera.com>2015-07-24 11:53:16 -0700
committerMarcelo Vanzin <vanzin@cloudera.com>2015-07-24 11:53:16 -0700
commit8399ba14873854ab2f80a0ccaf6adba499060365 (patch)
treec8be074bb7f9b0223564620d865f5a5801833396 /core
parent6aceaf3d62ee335570ddc07ccaf07e8c3776f517 (diff)
downloadspark-8399ba14873854ab2f80a0ccaf6adba499060365.tar.gz
spark-8399ba14873854ab2f80a0ccaf6adba499060365.tar.bz2
spark-8399ba14873854ab2f80a0ccaf6adba499060365.zip
[SPARK-9261] [STREAMING] Avoid calling APIs that expose shaded classes.
Doing this may cause weird errors when tests are run on maven, depending on the flags used. Instead, expose the needed functionality through methods that do not expose shaded classes. Author: Marcelo Vanzin <vanzin@cloudera.com> Closes #7601 from vanzin/SPARK-9261 and squashes the following commits: 4f64a16 [Marcelo Vanzin] [SPARK-9261] [streaming] Avoid calling APIs that expose shaded classes.
Diffstat (limited to 'core')
-rw-r--r--core/src/main/scala/org/apache/spark/ui/WebUI.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/src/main/scala/org/apache/spark/ui/WebUI.scala b/core/src/main/scala/org/apache/spark/ui/WebUI.scala
index 2c84e44859..61449847ad 100644
--- a/core/src/main/scala/org/apache/spark/ui/WebUI.scala
+++ b/core/src/main/scala/org/apache/spark/ui/WebUI.scala
@@ -107,6 +107,25 @@ private[spark] abstract class WebUI(
}
}
+ /**
+ * Add a handler for static content.
+ *
+ * @param resourceBase Root of where to find resources to serve.
+ * @param path Path in UI where to mount the resources.
+ */
+ def addStaticHandler(resourceBase: String, path: String): Unit = {
+ attachHandler(JettyUtils.createStaticHandler(resourceBase, path))
+ }
+
+ /**
+ * Remove a static content handler.
+ *
+ * @param path Path in UI to unmount.
+ */
+ def removeStaticHandler(path: String): Unit = {
+ handlers.find(_.getContextPath() == path).foreach(detachHandler)
+ }
+
/** Initialize all components of the server. */
def initialize()