Repository: spark
Updated Branches:
  refs/heads/branch-1.2 f318af0fd -> 09da688b0


[SPARK-4989][CORE] backport for branch-1.2 catch eventlog exception for wrong 
eventlog conf

JIRA is [SPARK-4989](https://issues.apache.org/jira/browse/SPARK-4989)

Author: Zhang, Liye <liye.zh...@intel.com>

Closes #3969 from liyezhang556520/apache-branch-1.2 and squashes the following 
commits:

5c77e42 [Zhang, Liye] catch eventlog exception for wrong eventlog conf


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/09da688b
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/09da688b
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/09da688b

Branch: refs/heads/branch-1.2
Commit: 09da688b033a00d22976ed056145278512bac83e
Parents: f318af0
Author: Zhang, Liye <liye.zh...@intel.com>
Authored: Fri Feb 6 11:49:40 2015 -0800
Committer: Andrew Or <and...@databricks.com>
Committed: Fri Feb 6 11:49:40 2015 -0800

----------------------------------------------------------------------
 .../org/apache/spark/deploy/master/Master.scala | 36 ++++++++++----------
 1 file changed, 18 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/09da688b/core/src/main/scala/org/apache/spark/deploy/master/Master.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/deploy/master/Master.scala 
b/core/src/main/scala/org/apache/spark/deploy/master/Master.scala
index aeb15ad..56169d2 100644
--- a/core/src/main/scala/org/apache/spark/deploy/master/Master.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/master/Master.scala
@@ -710,25 +710,25 @@ private[spark] class Master(
       return false
     }
 
-    val appEventLogDir = EventLoggingListener.getLogDirPath(eventLogDir, 
app.id)
-    val fileSystem = Utils.getHadoopFileSystem(appEventLogDir,
-      SparkHadoopUtil.get.newConfiguration(conf))
-    val eventLogInfo = EventLoggingListener.parseLoggingInfo(appEventLogDir, 
fileSystem)
-    val eventLogPaths = eventLogInfo.logPaths
-    val compressionCodec = eventLogInfo.compressionCodec
-
-    if (eventLogPaths.isEmpty) {
-      // Event logging is enabled for this application, but no event logs are 
found
-      val title = s"Application history not found (${app.id})"
-      var msg = s"No event logs found for application $appName in 
$appEventLogDir."
-      logWarning(msg)
-      msg += " Did you specify the correct logging directory?"
-      msg = URLEncoder.encode(msg, "UTF-8")
-      app.desc.appUiUrl = notFoundBasePath + s"?msg=$msg&title=$title"
-      return false
-    }
-
     try {
+      val appEventLogDir = EventLoggingListener.getLogDirPath(eventLogDir, 
app.id)
+      val fileSystem = Utils.getHadoopFileSystem(appEventLogDir,
+        SparkHadoopUtil.get.newConfiguration(conf))
+      val eventLogInfo = EventLoggingListener.parseLoggingInfo(appEventLogDir, 
fileSystem)
+      val eventLogPaths = eventLogInfo.logPaths
+      val compressionCodec = eventLogInfo.compressionCodec
+
+      if (eventLogPaths.isEmpty) {
+        // Event logging is enabled for this application, but no event logs 
are found
+        val title = s"Application history not found (${app.id})"
+        var msg = s"No event logs found for application $appName in 
$appEventLogDir."
+        logWarning(msg)
+        msg += " Did you specify the correct logging directory?"
+        msg = URLEncoder.encode(msg, "UTF-8")
+        app.desc.appUiUrl = notFoundBasePath + s"?msg=$msg&title=$title"
+        return false
+      }
+
       val replayBus = new ReplayListenerBus(eventLogPaths, fileSystem, 
compressionCodec)
       val ui = SparkUI.createHistoryUI(new SparkConf, replayBus, new 
SecurityManager(conf),
         appName + " (completed)", HistoryServer.UI_PATH_PREFIX + s"/${app.id}")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to