From 3377e6153e5a762aa662008179e08d0fb29b55b5 Mon Sep 17 00:00:00 2001 From: Imran Rashid Date: Mon, 16 Mar 2015 11:42:56 -0500 Subject: [PATCH] scaladoc --- .../org/apache/spark/status/api/v1/JsonRootResource.scala | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/scala/org/apache/spark/status/api/v1/JsonRootResource.scala b/core/src/main/scala/org/apache/spark/status/api/v1/JsonRootResource.scala index 8b6dba1b74b43..e8b502f983ec4 100644 --- a/core/src/main/scala/org/apache/spark/status/api/v1/JsonRootResource.scala +++ b/core/src/main/scala/org/apache/spark/status/api/v1/JsonRootResource.scala @@ -94,6 +94,11 @@ object JsonRootResource { private[spark] trait UIRoot { def getSparkUI(appKey: String): Option[SparkUI] def getApplicationInfoList: Seq[ApplicationInfo] + + /** + * Get the spark UI with the given appID, and apply a function + * to it. If there is no such app, throw an appropriate exception + */ def withSparkUI[T](appId: String)(f: SparkUI => T): T = { getSparkUI(appId) match { case Some(ui) => f(ui)