@@ -89,10 +89,10 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
89
89
90
90
override def getListing () = appList
91
91
92
- override def getAppInfo (appId : String ): ApplicationHistoryInfo = {
92
+ override def getAppUI (appId : String ): SparkUI = {
93
93
try {
94
94
val appLogDir = fs.getFileStatus(new Path (logDir, appId))
95
- loadAppInfo(appLogDir, true )
95
+ loadAppInfo(appLogDir, true )._2
96
96
} catch {
97
97
case e : FileNotFoundException => null
98
98
}
@@ -128,7 +128,7 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
128
128
val curr = currentApps.getOrElse(dir.getPath().getName(), null )
129
129
if (curr == null || curr.lastUpdated < getModificationTime(dir)) {
130
130
try {
131
- newApps += loadAppInfo(dir, false )
131
+ newApps += loadAppInfo(dir, false )._1
132
132
} catch {
133
133
case e : Exception => logError(s " Failed to load app info from directory $dir. " )
134
134
}
@@ -152,10 +152,10 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
152
152
* clicks on a specific application.
153
153
*
154
154
* @param logDir Directory with application's log files.
155
- * @param renderUI Whether to create the SparkUI for the application. If false, the "ui"
156
- * attribute of the returned object will be null .
155
+ * @param renderUI Whether to create the SparkUI for the application.
156
+ * @return A 2-tuple `(app info, ui)`. `ui` will be null if `renderUI` is false .
157
157
*/
158
- private def loadAppInfo (logDir : FileStatus , renderUI : Boolean ): ApplicationHistoryInfo = {
158
+ private def loadAppInfo (logDir : FileStatus , renderUI : Boolean ) = {
159
159
val elogInfo = EventLoggingListener .parseLoggingInfo(logDir.getPath(), fs)
160
160
val path = logDir.getPath
161
161
val appId = path.getName
@@ -173,14 +173,19 @@ private[history] class FsHistoryProvider(conf: SparkConf) extends ApplicationHis
173
173
}
174
174
175
175
replayBus.replay()
176
- ApplicationHistoryInfo (appId,
176
+ val appInfo = ApplicationHistoryInfo (appId,
177
177
appListener.appName,
178
178
appListener.startTime,
179
179
appListener.endTime,
180
180
getModificationTime(logDir),
181
- appListener.sparkUser,
182
- if (renderUI) appListener.viewAcls else null ,
183
- ui)
181
+ appListener.sparkUser)
182
+
183
+ if (ui != null ) {
184
+ val uiAclsEnabled = conf.getBoolean(" spark.history.ui.acls.enable" , false )
185
+ ui.getSecurityManager.setUIAcls(uiAclsEnabled)
186
+ ui.getSecurityManager.setViewAcls(appListener.sparkUser, appListener.viewAcls)
187
+ }
188
+ (appInfo, ui)
184
189
}
185
190
186
191
/** Return when this directory was last modified. */
0 commit comments