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

    https://github.com/apache/spark/pull/204#discussion_r11253731
  
    --- Diff: 
core/src/main/scala/org/apache/spark/deploy/history/HistoryServer.scala ---
    @@ -0,0 +1,221 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.deploy.history
    +
    +import java.net.URI
    +import javax.servlet.http.HttpServletRequest
    +
    +import scala.collection.mutable
    +import scala.concurrent._
    +import scala.concurrent.ExecutionContext.Implicits.global
    +import scala.util.{Failure, Success}
    +
    +import org.apache.hadoop.fs.{FileStatus, Path}
    +import org.eclipse.jetty.servlet.ServletContextHandler
    +
    +import org.apache.spark.{Logging, SecurityManager, SparkConf}
    +import org.apache.spark.deploy.SparkUIContainer
    +import org.apache.spark.ui.SparkUI
    +import org.apache.spark.ui.JettyUtils._
    +import org.apache.spark.util.Utils
    +import org.apache.spark.scheduler.{ApplicationEventListener, 
ReplayListenerBus}
    +
    +/**
    + * A web server that renders SparkUIs of finished applications.
    + *
    + * For the standalone mode, MasterWebUI already achieves this 
functionality. Thus, the
    + * main use case of the HistoryServer is in other deploy modes (e.g. Yarn 
or Mesos).
    + *
    + * The logging directory structure is as follows: Within the given base 
directory, each
    + * application's event logs are maintained in the application's own 
sub-directory. This
    + * is the same structure as maintained in the event log write code path in
    + * EventLoggingListener.
    + *
    + * @param baseLogDir The base directory in which event logs are found
    + * @param requestedPort The requested port to which this server is to be 
bound
    + */
    +class HistoryServer(val baseLogDir: String, requestedPort: Int)
    +  extends SparkUIContainer("History Server") with Logging {
    +
    +  private val fileSystem = Utils.getHadoopFileSystem(new URI(baseLogDir))
    +  private val host = 
Option(System.getenv("SPARK_PUBLIC_DNS")).getOrElse(Utils.localHostName())
    +  private val port = requestedPort
    +  private val conf = new SparkConf
    +  private val securityManager = new SecurityManager(conf)
    +  private val indexPage = new IndexPage(this)
    +
    +  // A timestamp of when the disk was last accessed to check for log 
updates
    +  private var lastLogCheck = -1L
    +
    +  private val handlers = Seq[ServletContextHandler](
    +    createStaticHandler(HistoryServer.STATIC_RESOURCE_DIR, "/static"),
    +    createServletHandler("/",
    +      (request: HttpServletRequest) => indexPage.render(request), 
securityMgr = securityManager)
    +  )
    +
    +  val appIdToInfo = mutable.HashMap[String, ApplicationHistoryInfo]()
    +
    +  /** Bind to the HTTP server behind this web interface */
    +  override def bind() {
    +    try {
    +      serverInfo = Some(startJettyServer(host, port, handlers, conf))
    --- End diff --
    
    does this have the same problem Patrick just fixed in SPARK-1324 with 
binding to public dns


---
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