Skip to content

Commit b8578a7

Browse files
committed
Implemented renderJson for EnvironmentPage
1 parent 353a423 commit b8578a7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,29 @@ package org.apache.spark.ui.env
1919

2020
import javax.servlet.http.HttpServletRequest
2121

22+
import org.json4s.{JObject, JValue}
23+
import org.json4s.JsonDSL._
24+
2225
import scala.xml.Node
2326

2427
import org.apache.spark.ui.{UIUtils, WebUIPage}
2528

2629
private[ui] class EnvironmentPage(parent: EnvironmentTab) extends WebUIPage("") {
2730
private val listener = parent.listener
2831

32+
override def renderJson(request: HttpServletRequest): JValue = {
33+
val jvmInfoJson = ("RUntime Informationf" -> listener.jvmInformation.foldLeft(JObject())(_ ~ _))
34+
val sparkPropertiesJson = ("Spark Properties" -> listener.sparkProperties.foldLeft(JObject())(_ ~ _))
35+
val systemPropertiesJson = ("System Properties" -> listener.systemProperties.foldLeft(JObject())(_ ~ _))
36+
val classPathEntriesJson = ("Classpath Entries" -> listener.classpathEntries.foldLeft(JObject())(_ ~ _))
37+
38+
val environment = ("Environment" -> jvmInfoJson ~
39+
sparkPropertiesJson ~
40+
systemPropertiesJson ~
41+
classPathEntriesJson)
42+
environment
43+
}
44+
2945
def render(request: HttpServletRequest): Seq[Node] = {
3046
val runtimeInformationTable = UIUtils.listingTable(
3147
propertyHeader, jvmRow, listener.jvmInformation, fixedWidth = true)

0 commit comments

Comments
 (0)