Repository: spark
Updated Branches:
  refs/heads/master f7ac8c2b1 -> cb0eae3b7


[SPARK-4158] Fix for missing resources.

Mesos offers may not contain all resources, and Spark needs to check to
ensure they are present and sufficient.  Spark may throw an erroneous
exception when resources aren't present.

Author: Brenden Matthews <bren...@diddyinc.com>

Closes #3024 from brndnmtthws/fix-mesos-resource-misuse and squashes the 
following commits:

e5f9580 [Brenden Matthews] [SPARK-4158] Fix for missing resources.


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

Branch: refs/heads/master
Commit: cb0eae3b78d7f6f56c0b9521ee48564a4967d3de
Parents: f7ac8c2
Author: Brenden Matthews <bren...@diddyinc.com>
Authored: Wed Nov 5 16:02:44 2014 -0800
Committer: Andrew Or <and...@databricks.com>
Committed: Wed Nov 5 16:02:44 2014 -0800

----------------------------------------------------------------------
 .../scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala     | 3 +--
 .../spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala     | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/cb0eae3b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
 
b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
index e4b8598..5289661 100644
--- 
a/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
+++ 
b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/CoarseMesosSchedulerBackend.scala
@@ -242,8 +242,7 @@ private[spark] class CoarseMesosSchedulerBackend(
     for (r <- res if r.getName == name) {
       return r.getScalar.getValue
     }
-    // If we reached here, no resource with the required name was present
-    throw new IllegalArgumentException("No resource called " + name + " in " + 
res)
+    0
   }
 
   /** Build a Mesos resource protobuf object */

http://git-wip-us.apache.org/repos/asf/spark/blob/cb0eae3b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
----------------------------------------------------------------------
diff --git 
a/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
 
b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
index 7d097a3..c5f3493 100644
--- 
a/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
+++ 
b/core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerBackend.scala
@@ -278,8 +278,7 @@ private[spark] class MesosSchedulerBackend(
     for (r <- res if r.getName == name) {
       return r.getScalar.getValue
     }
-    // If we reached here, no resource with the required name was present
-    throw new IllegalArgumentException("No resource called " + name + " in " + 
res)
+    0
   }
 
   /** Turn a Spark TaskDescription into a Mesos task */


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

Reply via email to