-
Notifications
You must be signed in to change notification settings - Fork 28.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-20355] Add per application spark version on the history server headerpage #17658
Changes from 1 commit
1f50b27
21f7903
bad5ea2
5f6e80b
097e7cc
5533775
7350649
e7da27d
f1fa890
298248e
bafad1a
52f414c
dad87a6
93e7a20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,18 +243,19 @@ private[history] class FsHistoryProvider(conf: SparkConf, clock: Clock) | |
applications.get(appId).flatMap { appInfo => | ||
appInfo.attempts.find(_.attemptId == attemptId).flatMap { attempt => | ||
val replayBus = new ReplayListenerBus() | ||
val fileStatus = fs.getFileStatus(new Path(logDir, attempt.logPath)) | ||
val appListener = replay(fileStatus, isApplicationCompleted(fileStatus), replayBus) | ||
|
||
val ui = { | ||
val conf = this.conf.clone() | ||
val appSecManager = new SecurityManager(conf) | ||
SparkUI.createHistoryUI(conf, replayBus, appSecManager, appInfo.name, | ||
HistoryServer.getAttemptURI(appId, attempt.attemptId), attempt.startTime) | ||
SparkUI.createHistoryUI(conf, replayBus, appSecManager, | ||
appListener.appSparkVersion.getOrElse(""), appInfo.name, | ||
HistoryServer.getAttemptURI(appId, attempt.attemptId), | ||
attempt.startTime) | ||
// Do not call ui.bind() to avoid creating a new server for each application | ||
} | ||
|
||
val fileStatus = fs.getFileStatus(new Path(logDir, attempt.logPath)) | ||
|
||
val appListener = replay(fileStatus, isApplicationCompleted(fileStatus), replayBus) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Sorry about it, just saw you moved this two lines above. |
||
|
||
if (appListener.appId.isDefined) { | ||
ui.getSecurityManager.setAcls(HISTORY_UI_ACLS_ENABLE) | ||
// make sure to set admin acls before view acls so they are properly picked up | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ private[spark] class ApplicationEventListener extends SparkListener { | |
var adminAcls: Option[String] = None | ||
var viewAclsGroups: Option[String] = None | ||
var adminAclsGroups: Option[String] = None | ||
var appSparkVersion: Option[String] = None | ||
|
||
override def onApplicationStart(applicationStart: SparkListenerApplicationStart) { | ||
appName = Some(applicationStart.appName) | ||
|
@@ -57,4 +58,9 @@ private[spark] class ApplicationEventListener extends SparkListener { | |
adminAclsGroups = allProperties.get("spark.admin.acls.groups") | ||
} | ||
} | ||
|
||
override def onOtherEvent(event:SparkListenerEvent): Unit = event match { | ||
case SparkListenerLogStart(sparkVersion) => | ||
appSparkVersion = Some(sparkVersion) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need a "catch all" here:
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -160,7 +160,6 @@ case class SparkListenerApplicationEnd(time: Long) extends SparkListenerEvent | |
|
||
/** | ||
* An internal class that describes the metadata of an event log. | ||
* This event is not meant to be posted to listeners downstream. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason this note was here? What was the reasoning behind it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was only for metadata info, so when this was written it was just not meant to be consumed but now we can reuse it for this case |
||
*/ | ||
private[spark] case class SparkListenerLogStart(sparkVersion: String) extends SparkListenerEvent | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,6 @@ private[spark] trait SparkListenerBus | |
listener.onNodeUnblacklisted(nodeUnblacklisted) | ||
case blockUpdated: SparkListenerBlockUpdated => | ||
listener.onBlockUpdated(blockUpdated) | ||
case logStart: SparkListenerLogStart => // ignore event log metadata | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't looked at this closely, but will allowing this through cause any issues? Why was it ignored before? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not see it getting consumed apart from registering some metadata, so I guess it should be fine as this event already logs the version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this change the behavior of
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that if this is gonna be posted on the bus it might be better to make it public and Adding new events is not an issue, but posting an event that people can't handle is a little odd. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not too sure if it will change any behavior and precisely why we post it to other events, in case someone wants to listen to them and utilize the event like in this scenario |
||
case _ => listener.onOtherEvent(event) | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ private[spark] class SparkUI private ( | |
val jobProgressListener: JobProgressListener, | ||
val storageListener: StorageListener, | ||
val operationGraphListener: RDDOperationGraphListener, | ||
val appSparkVersion: String, | ||
var appName: String, | ||
val basePath: String, | ||
val startTime: Long) | ||
|
@@ -139,6 +140,8 @@ private[spark] abstract class SparkUITab(parent: SparkUI, prefix: String) | |
|
||
def appName: String = parent.appName | ||
|
||
def appSparkVersion: String = parent.appSparkVersion | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit, remove extra line if you are making changes. |
||
} | ||
|
||
private[spark] object SparkUI { | ||
|
@@ -156,23 +159,25 @@ private[spark] object SparkUI { | |
sc: SparkContext, | ||
conf: SparkConf, | ||
listenerBus: SparkListenerBus, | ||
appSparkVersion: String, | ||
jobProgressListener: JobProgressListener, | ||
securityManager: SecurityManager, | ||
appName: String, | ||
startTime: Long): SparkUI = { | ||
create(Some(sc), conf, listenerBus, securityManager, appName, | ||
create(Some(sc), conf, listenerBus, securityManager, appSparkVersion, appName, | ||
jobProgressListener = Some(jobProgressListener), startTime = startTime) | ||
} | ||
|
||
def createHistoryUI( | ||
conf: SparkConf, | ||
listenerBus: SparkListenerBus, | ||
securityManager: SecurityManager, | ||
appSparkVersion: String, | ||
appName: String, | ||
basePath: String, | ||
startTime: Long): SparkUI = { | ||
val sparkUI = create( | ||
None, conf, listenerBus, securityManager, appName, basePath, startTime = startTime) | ||
val sparkUI = create(None, conf, listenerBus, securityManager, | ||
appSparkVersion, appName, basePath, startTime = startTime) | ||
|
||
val listenerFactories = ServiceLoader.load(classOf[SparkHistoryListenerFactory], | ||
Utils.getContextOrSparkClassLoader).asScala | ||
|
@@ -195,6 +200,7 @@ private[spark] object SparkUI { | |
conf: SparkConf, | ||
listenerBus: SparkListenerBus, | ||
securityManager: SecurityManager, | ||
appSparkVersion: String, | ||
appName: String, | ||
basePath: String = "", | ||
jobProgressListener: Option[JobProgressListener] = None, | ||
|
@@ -218,8 +224,8 @@ private[spark] object SparkUI { | |
listenerBus.addListener(storageListener) | ||
listenerBus.addListener(operationGraphListener) | ||
|
||
new SparkUI(sc, conf, securityManager, environmentListener, storageStatusListener, | ||
executorsListener, _jobProgressListener, storageListener, operationGraphListener, | ||
appName, basePath, startTime) | ||
new SparkUI(sc, conf, securityManager, environmentListener, | ||
storageStatusListener, executorsListener, _jobProgressListener, storageListener, | ||
operationGraphListener, appSparkVersion, appName, basePath, startTime) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think adding this line wrap is necessary