Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-1198 1402164df -> 160ac38a9


IGNITE-1198 - Use correct number of executors.


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

Branch: refs/heads/ignite-1198
Commit: 1f3249540bfbbdb412556fcfb7b1bfd1c84afd9e
Parents: 1402164
Author: Alexey Goncharuk <agoncha...@gridgain.com>
Authored: Wed Aug 5 12:57:33 2015 -0700
Committer: Alexey Goncharuk <agoncha...@gridgain.com>
Committed: Wed Aug 5 12:57:33 2015 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/ignite/spark/IgniteContext.scala  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/1f324954/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
----------------------------------------------------------------------
diff --git 
a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala 
b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
index 115e34b..6e48017 100644
--- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteContext.scala
@@ -45,8 +45,9 @@ class IgniteContext[K, V](
     private val igniteHome = IgniteUtils.getIgniteHome
 
     if (!client) {
-        // Minimum 1 executor is required for any Spark job.
-        val workers = sparkContext.getConf.getInt("spark.executor.instances", 
1)
+        // Get required number of executors with default equals to number of 
available executors.
+        val workers = sparkContext.getConf.getInt("spark.executor.instances",
+            sparkContext.getExecutorStorageStatus.length)
 
         if (workers <= 0)
             throw new IllegalStateException("No Spark executors found to start 
Ignite nodes.")

Reply via email to