spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwend...@apache.org
Subject [1/3] git commit: Only log error on missing jar to allow spark examples to jar.
Date Sun, 19 Jan 2014 19:33:19 GMT
Updated Branches:
  refs/heads/master 256a3553c -> 792d9084e


Only log error on missing jar to allow spark examples to jar.


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

Branch: refs/heads/master
Commit: ceb79a393117d725398e333bddc237613818c333
Parents: fe8a354
Author: Thomas Graves <tgraves@apache.org>
Authored: Sun Jan 19 12:16:58 2014 -0600
Committer: Thomas Graves <tgraves@apache.org>
Committed: Sun Jan 19 12:16:58 2014 -0600

----------------------------------------------------------------------
 core/src/main/scala/org/apache/spark/SparkContext.scala | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/ceb79a39/core/src/main/scala/org/apache/spark/SparkContext.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/SparkContext.scala b/core/src/main/scala/org/apache/spark/SparkContext.scala
index ddd7d60..a05d5c5 100644
--- a/core/src/main/scala/org/apache/spark/SparkContext.scala
+++ b/core/src/main/scala/org/apache/spark/SparkContext.scala
@@ -708,8 +708,11 @@ class SparkContext(
                 env.httpFileServer.addJar(new File(fileName))
               } catch {
                 case e: Exception => {
+                  // For now just throw an error but allow to go through so spark examples
work.
+                  // The spark examples don't really need the jar distributed since its also

+                  // the app jar.
                   logError("Error adding jar (" + e + "), was the --addJars option used?")
-                  throw e
+                  null
                 }
               }
             } else {
@@ -722,8 +725,10 @@ class SparkContext(
             path
         }
       }
-      addedJars(key) = System.currentTimeMillis
-      logInfo("Added JAR " + path + " at " + key + " with timestamp " + addedJars(key))
+      if (key != null) {
+        addedJars(key) = System.currentTimeMillis
+        logInfo("Added JAR " + path + " at " + key + " with timestamp " + addedJars(key))
+      }
     }
   }
 


Mime
View raw message