ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [17/32] ignite git commit: IGNITE-3232 - Fixed the number of iterations to find an affinity key.
Date Mon, 06 Jun 2016 11:57:16 GMT
IGNITE-3232 - Fixed the number of iterations to find an affinity key.


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

Branch: refs/heads/ignite-3212
Commit: 7fc1a7f8ecba07869f8706091f076079dd83cb8e
Parents: 9df1b90
Author: Alexey Goncharuk <alexey.goncharuk@gmail.com>
Authored: Thu Jun 2 22:52:39 2016 +0300
Committer: Valentin Kulichenko <valentin.lulichenko@gmail.com>
Committed: Fri Jun 3 20:12:24 2016 +0300

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


http://git-wip-us.apache.org/repos/asf/ignite/blob/7fc1a7f8/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
----------------------------------------------------------------------
diff --git a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
index 036dfe6..9ef9846 100644
--- a/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
+++ b/modules/spark/src/main/scala/org/apache/ignite/spark/IgniteRDD.scala
@@ -334,7 +334,8 @@ class IgniteRDD[K, V] (
     private def affinityKeyFunc(value: V, node: ClusterNode): IgniteUuid = {
         val aff = ic.ignite().affinity[IgniteUuid](cacheName)
 
-        Stream.from(1, 1000).map(_ ⇒ IgniteUuid.randomUuid()).find(node == null || aff.mapKeyToNode(_).eq(node))
+        Stream.from(1, Math.max(1000, aff.partitions() * 2))
+            .map(_ ⇒ IgniteUuid.randomUuid()).find(node == null || aff.mapKeyToNode(_).eq(node))
             .getOrElse(IgniteUuid.randomUuid())
     }
 }


Mime
View raw message