diff options
author | Ali Ghodsi <alig@cs.berkeley.edu> | 2013-08-19 19:11:02 -0700 |
---|---|---|
committer | Ali Ghodsi <alig@cs.berkeley.edu> | 2013-08-20 16:16:05 -0700 |
commit | 5db41919b5aafcad050726601c6f3be8e0bf879a (patch) | |
tree | 03bbfad516d019a2a6197c6c678b9e787b43e564 /core/src/test | |
parent | 7b123b3126d555237f31a0787411c4bbc1abd39a (diff) | |
download | spark-5db41919b5aafcad050726601c6f3be8e0bf879a.tar.gz spark-5db41919b5aafcad050726601c6f3be8e0bf879a.tar.bz2 spark-5db41919b5aafcad050726601c6f3be8e0bf879a.zip |
Added a test to make sure no locality preferences are ignored
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/scala/spark/RDDSuite.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/test/scala/spark/RDDSuite.scala b/core/src/test/scala/spark/RDDSuite.scala index 9e73703371..3c1b387d16 100644 --- a/core/src/test/scala/spark/RDDSuite.scala +++ b/core/src/test/scala/spark/RDDSuite.scala @@ -175,6 +175,11 @@ class RDDSuite extends FunSuite with SharedSparkContext { null) } test("cogrouped RDDs with locality") { + val data3 = sc.makeRDD(List((1,List("a","c")), (2,List("a","b","c")), (3,List("b")))) + val coalesced3 = data3.coalesce(3) + val list3 = coalesced3.partitions.map(p => p.asInstanceOf[CoalescedRDDPartition]) + assert(list3.map(p => p.preferredLocation).length === 3, "Locality preferences are dropped") + // RDD with locality preferences spread (non-randomly) over 6 machines, m0 through m5 val data = sc.makeRDD((1 to 9).map(i => (i, (i to (i+2)).map{ j => "m" + (j%6)}))) val coalesced1 = data.coalesce(3) |