Skip to content

Commit 95cad7c

Browse files
committed
Merge remote-tracking branch 'upstream/master' into dt-opt3
Conflicts: mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala
2 parents 5f94342 + 115eeb3 commit 95cad7c

File tree

31 files changed

+176
-121
lines changed

31 files changed

+176
-121
lines changed

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

core/src/main/scala/org/apache/spark/deploy/master/Master.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ private[spark] class Master(
697697
appIdToUI(app.id) = ui
698698
webUi.attachSparkUI(ui)
699699
// Application UI is successfully rebuilt, so link the Master UI to it
700-
app.desc.appUiUrl = ui.basePath
700+
app.desc.appUiUrl = ui.getBasePath
701701
true
702702
} catch {
703703
case e: Exception =>

core/src/main/scala/org/apache/spark/scheduler/EventLoggingListener.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ private[spark] class EventLoggingListener(
5454
private val testing = sparkConf.getBoolean("spark.eventLog.testing", false)
5555
private val outputBufferSize = sparkConf.getInt("spark.eventLog.buffer.kb", 100) * 1024
5656
private val logBaseDir = sparkConf.get("spark.eventLog.dir", DEFAULT_LOG_DIR).stripSuffix("/")
57-
private val name = appName.replaceAll("[ :/]", "-").toLowerCase + "-" + System.currentTimeMillis
57+
private val name = appName.replaceAll("[ :/]", "-").replaceAll("[${}'\"]", "_")
58+
.toLowerCase + "-" + System.currentTimeMillis
5859
val logDir = Utils.resolveURI(logBaseDir) + "/" + name.stripSuffix("/")
5960

6061
protected val logger = new FileLogger(logDir, sparkConf, hadoopConf, outputBufferSize,

core/src/main/scala/org/apache/spark/ui/SparkUI.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ private[spark] class SparkUI(
7676
}
7777
}
7878

79+
def getAppName = appName
80+
7981
/** Set the app name for this UI. */
8082
def setAppName(name: String) {
8183
appName = name
@@ -100,6 +102,13 @@ private[spark] class SparkUI(
100102
private[spark] def appUIAddress = s"http://$appUIHostPort"
101103
}
102104

105+
private[spark] abstract class SparkUITab(parent: SparkUI, prefix: String)
106+
extends WebUITab(parent, prefix) {
107+
108+
def appName: String = parent.getAppName
109+
110+
}
111+
103112
private[spark] object SparkUI {
104113
val DEFAULT_PORT = 4040
105114
val STATIC_RESOURCE_DIR = "org/apache/spark/ui/static"

core/src/main/scala/org/apache/spark/ui/UIUtils.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,17 +163,15 @@ private[spark] object UIUtils extends Logging {
163163

164164
/** Returns a spark page with correctly formatted headers */
165165
def headerSparkPage(
166-
content: => Seq[Node],
167-
basePath: String,
168-
appName: String,
169166
title: String,
170-
tabs: Seq[WebUITab],
171-
activeTab: WebUITab,
167+
content: => Seq[Node],
168+
activeTab: SparkUITab,
172169
refreshInterval: Option[Int] = None): Seq[Node] = {
173170

174-
val header = tabs.map { tab =>
171+
val appName = activeTab.appName
172+
val header = activeTab.headerTabs.map { tab =>
175173
<li class={if (tab == activeTab) "active" else ""}>
176-
<a href={prependBaseUri(basePath, "/" + tab.prefix)}>{tab.name}</a>
174+
<a href={prependBaseUri(activeTab.basePath, "/" + tab.prefix)}>{tab.name}</a>
177175
</li>
178176
}
179177

core/src/main/scala/org/apache/spark/ui/WebUI.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ private[spark] abstract class WebUI(
5050
protected val publicHostName = Option(System.getenv("SPARK_PUBLIC_DNS")).getOrElse(localHostName)
5151
private val className = Utils.getFormattedClassName(this)
5252

53+
def getBasePath: String = basePath
5354
def getTabs: Seq[WebUITab] = tabs.toSeq
5455
def getHandlers: Seq[ServletContextHandler] = handlers.toSeq
5556
def getSecurityManager: SecurityManager = securityManager
@@ -135,6 +136,8 @@ private[spark] abstract class WebUITab(parent: WebUI, val prefix: String) {
135136

136137
/** Get a list of header tabs from the parent UI. */
137138
def headerTabs: Seq[WebUITab] = parent.getTabs
139+
140+
def basePath: String = parent.getBasePath
138141
}
139142

140143

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ import scala.xml.Node
2424
import org.apache.spark.ui.{UIUtils, WebUIPage}
2525

2626
private[ui] class EnvironmentPage(parent: EnvironmentTab) extends WebUIPage("") {
27-
private val appName = parent.appName
28-
private val basePath = parent.basePath
2927
private val listener = parent.listener
3028

3129
def render(request: HttpServletRequest): Seq[Node] = {
@@ -45,7 +43,7 @@ private[ui] class EnvironmentPage(parent: EnvironmentTab) extends WebUIPage("")
4543
<h4>Classpath Entries</h4> {classpathEntriesTable}
4644
</span>
4745

48-
UIUtils.headerSparkPage(content, basePath, appName, "Environment", parent.headerTabs, parent)
46+
UIUtils.headerSparkPage("Environment", content, parent)
4947
}
5048

5149
private def propertyHeader = Seq("Name", "Value")

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ import org.apache.spark.annotation.DeveloperApi
2121
import org.apache.spark.scheduler._
2222
import org.apache.spark.ui._
2323

24-
private[ui] class EnvironmentTab(parent: SparkUI) extends WebUITab(parent, "environment") {
25-
val appName = parent.appName
26-
val basePath = parent.basePath
24+
private[ui] class EnvironmentTab(parent: SparkUI) extends SparkUITab(parent, "environment") {
2725
val listener = new EnvironmentListener
2826

2927
attachPage(new EnvironmentPage(this))

core/src/main/scala/org/apache/spark/ui/exec/ExecutorsPage.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ private case class ExecutorSummaryInfo(
4343
maxMemory: Long)
4444

4545
private[ui] class ExecutorsPage(parent: ExecutorsTab) extends WebUIPage("") {
46-
private val appName = parent.appName
47-
private val basePath = parent.basePath
4846
private val listener = parent.listener
4947

5048
def render(request: HttpServletRequest): Seq[Node] = {
@@ -101,8 +99,7 @@ private[ui] class ExecutorsPage(parent: ExecutorsTab) extends WebUIPage("") {
10199
</div>
102100
</div>;
103101

104-
UIUtils.headerSparkPage(content, basePath, appName, "Executors (" + execInfo.size + ")",
105-
parent.headerTabs, parent)
102+
UIUtils.headerSparkPage("Executors (" + execInfo.size + ")", content, parent)
106103
}
107104

108105
/** Render an HTML row representing an executor */

core/src/main/scala/org/apache/spark/ui/exec/ExecutorsTab.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ import org.apache.spark.ExceptionFailure
2323
import org.apache.spark.annotation.DeveloperApi
2424
import org.apache.spark.scheduler._
2525
import org.apache.spark.storage.StorageStatusListener
26-
import org.apache.spark.ui.{SparkUI, WebUITab}
26+
import org.apache.spark.ui.{SparkUI, SparkUITab}
2727

28-
private[ui] class ExecutorsTab(parent: SparkUI) extends WebUITab(parent, "executors") {
29-
val appName = parent.appName
30-
val basePath = parent.basePath
28+
private[ui] class ExecutorsTab(parent: SparkUI) extends SparkUITab(parent, "executors") {
3129
val listener = new ExecutorsListener(parent.storageStatusListener)
3230

3331
attachPage(new ExecutorsPage(this))

0 commit comments

Comments
 (0)