Github user andrewor14 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/42#discussion_r10504506
  
    --- Diff: core/src/main/scala/org/apache/spark/ui/env/EnvironmentUI.scala 
---
    @@ -19,76 +19,74 @@ package org.apache.spark.ui.env
     
     import javax.servlet.http.HttpServletRequest
     
    -import scala.collection.JavaConversions._
    -import scala.util.Properties
     import scala.xml.Node
     
     import org.eclipse.jetty.servlet.ServletContextHandler
     
    -import org.apache.spark.SparkContext
    +import org.apache.spark.scheduler._
    +import org.apache.spark.ui._
     import org.apache.spark.ui.JettyUtils._
     import org.apache.spark.ui.Page.Environment
    -import org.apache.spark.ui.UIUtils
     
    -private[spark] class EnvironmentUI(sc: SparkContext) {
    +private[ui] class EnvironmentUI(parent: SparkUI) {
    +  private val appName = parent.appName
    +  private val basePath = parent.basePath
    +  private var _listener: Option[EnvironmentListener] = None
    +
    +  lazy val listener = _listener.get
    +
    +  def start() {
    +    _listener = Some(new EnvironmentListener)
    +  }
     
       def getHandlers = Seq[ServletContextHandler](
         createServletHandler("/environment",
    -      createServlet((request: HttpServletRequest) => envDetails(request), 
sc.env.securityManager))
    +      (request: HttpServletRequest) => render(request), 
parent.securityManager, basePath)
       )
     
    -  def envDetails(request: HttpServletRequest): Seq[Node] = {
    -    val jvmInformation = Seq(
    -      ("Java Version", "%s (%s)".format(Properties.javaVersion, 
Properties.javaVendor)),
    -      ("Java Home", Properties.javaHome),
    -      ("Scala Version", Properties.versionString),
    -      ("Scala Home", Properties.scalaHome)
    -    ).sorted
    -    def jvmRow(kv: (String, String)) = 
<tr><td>{kv._1}</td><td>{kv._2}</td></tr>
    -    def jvmTable =
    -      UIUtils.listingTable(Seq("Name", "Value"), jvmRow, jvmInformation, 
fixedWidth = true)
    -
    -    val sparkProperties = sc.conf.getAll.sorted
    -
    -    val systemProperties = System.getProperties.iterator.toSeq
    -    val classPathProperty = systemProperties.find { case (k, v) =>
    -      k == "java.class.path"
    -    }.getOrElse(("", ""))
    -    val otherProperties = systemProperties.filter { case (k, v) =>
    -      k != "java.class.path" && !k.startsWith("spark.")
    -    }.sorted
    -
    -    val propertyHeaders = Seq("Name", "Value")
    -    def propertyRow(kv: (String, String)) = 
<tr><td>{kv._1}</td><td>{kv._2}</td></tr>
    -    val sparkPropertyTable =
    -      UIUtils.listingTable(propertyHeaders, propertyRow, sparkProperties, 
fixedWidth = true)
    -    val otherPropertyTable =
    -      UIUtils.listingTable(propertyHeaders, propertyRow, otherProperties, 
fixedWidth = true)
    -
    -    val classPathEntries = classPathProperty._2
    -        .split(sc.conf.get("path.separator", ":"))
    -        .filterNot(e => e.isEmpty)
    -        .map(e => (e, "System Classpath"))
    -    val addedJars = sc.addedJars.iterator.toSeq.map{case (path, time) => 
(path, "Added By User")}
    -    val addedFiles = sc.addedFiles.iterator.toSeq.map{case (path, time) => 
(path, "Added By User")}
    -    val classPath = (addedJars ++ addedFiles ++ classPathEntries).sorted
    -
    -    val classPathHeaders = Seq("Resource", "Source")
    -    def classPathRow(data: (String, String)) = 
<tr><td>{data._1}</td><td>{data._2}</td></tr>
    -    val classPathTable =
    -      UIUtils.listingTable(classPathHeaders, classPathRow, classPath, 
fixedWidth = true)
    -
    --- End diff --
    
    Moved to SparkEnv.scala


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to