spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [43/50] git commit: Change Exception to NoSuchElementException and minor style fix
Date Fri, 04 Oct 2013 17:55:30 GMT
Change Exception to NoSuchElementException and minor style fix


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

Branch: refs/heads/scala-2.10
Commit: 77e9da1f34a0b9e556d7c0bbd4aeaa5c635b881d
Parents: 85024ac
Author: jerryshao <saisai.shao@intel.com>
Authored: Sun Sep 22 16:50:08 2013 +0800
Committer: jerryshao <saisai.shao@intel.com>
Committed: Sun Sep 22 16:50:08 2013 +0800

----------------------------------------------------------------------
 .../spark/scheduler/cluster/SchedulableBuilder.scala   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-spark/blob/77e9da1f/core/src/main/scala/org/apache/spark/scheduler/cluster/SchedulableBuilder.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/scheduler/cluster/SchedulableBuilder.scala
b/core/src/main/scala/org/apache/spark/scheduler/cluster/SchedulableBuilder.scala
index 65b844a..114617c 100644
--- a/core/src/main/scala/org/apache/spark/scheduler/cluster/SchedulableBuilder.scala
+++ b/core/src/main/scala/org/apache/spark/scheduler/cluster/SchedulableBuilder.scala
@@ -18,7 +18,7 @@
 package org.apache.spark.scheduler.cluster
 
 import java.io.{FileInputStream, InputStream}
-import java.util.Properties
+import java.util.{NoSuchElementException, Properties}
 
 import org.apache.spark.Logging
 
@@ -65,15 +65,15 @@ private[spark] class FairSchedulableBuilder(val rootPool: Pool)
   override def buildPools() {
     var is: Option[InputStream] = None
     try {
-      is = Option{
-        schedulerAllocFile.map{ f =>
+      is = Option {
+        schedulerAllocFile.map { f =>
           new FileInputStream(f)
-        }.getOrElse{
+        }.getOrElse {
           getClass.getClassLoader.getResourceAsStream(DEFAULT_SCHEDULER_FILE)
         }
       }
 
-      is.foreach{ i => buildFairSchedulerPool(i) }
+      is.foreach { i => buildFairSchedulerPool(i) }
     } finally {
       is.foreach(_.close())
     }
@@ -106,7 +106,8 @@ private[spark] class FairSchedulableBuilder(val rootPool: Pool)
         try {
           schedulingMode = SchedulingMode.withName(xmlSchedulingMode)
         } catch {
-          case e: Exception => logWarning("Error xml schedulingMode, using default schedulingMode")
+          case e: NoSuchElementException =>
+            logWarning("Error xml schedulingMode, using default schedulingMode")
         }
       }
 


Mime
View raw message