aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/scala
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2013-06-22 16:22:47 -0700
committerMatei Zaharia <matei@eecs.berkeley.edu>2013-06-22 16:22:47 -0700
commit3e61beff7b41217a40afdccd1e413d9b90fe6e54 (patch)
treecd820cc06b7d3281573bf7366fc07003b318ebb4 /core/src/test/scala
parentd92d3f7938dec954ea31de232f50cafd4b644065 (diff)
parent1d9f0df0652f455145d2dfed43a9407df6de6c43 (diff)
downloadspark-3e61beff7b41217a40afdccd1e413d9b90fe6e54.tar.gz
spark-3e61beff7b41217a40afdccd1e413d9b90fe6e54.tar.bz2
spark-3e61beff7b41217a40afdccd1e413d9b90fe6e54.zip
Merge pull request #648 from shivaram/netty-dbg
Shuffle fixes and cleanup
Diffstat (limited to 'core/src/test/scala')
-rw-r--r--core/src/test/scala/spark/ShuffleSuite.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/core/src/test/scala/spark/ShuffleSuite.scala b/core/src/test/scala/spark/ShuffleSuite.scala
index b967016cf7..1916885a73 100644
--- a/core/src/test/scala/spark/ShuffleSuite.scala
+++ b/core/src/test/scala/spark/ShuffleSuite.scala
@@ -367,6 +367,31 @@ class ShuffleSuite extends FunSuite with ShouldMatchers with LocalSparkContext {
assert(nonEmptyBlocks.size <= 4)
}
+ test("zero sized blocks without kryo") {
+ // Use a local cluster with 2 processes to make sure there are both local and remote blocks
+ sc = new SparkContext("local-cluster[2,1,512]", "test")
+
+ // 10 partitions from 4 keys
+ val NUM_BLOCKS = 10
+ val a = sc.parallelize(1 to 4, NUM_BLOCKS)
+ val b = a.map(x => (x, x*2))
+
+ // NOTE: The default Java serializer should create zero-sized blocks
+ val c = new ShuffledRDD(b, new HashPartitioner(10))
+
+ val shuffleId = c.dependencies.head.asInstanceOf[ShuffleDependency[Int, Int]].shuffleId
+ assert(c.count === 4)
+
+ val blockSizes = (0 until NUM_BLOCKS).flatMap { id =>
+ val statuses = SparkEnv.get.mapOutputTracker.getServerStatuses(shuffleId, id)
+ statuses.map(x => x._2)
+ }
+ val nonEmptyBlocks = blockSizes.filter(x => x > 0)
+
+ // We should have at most 4 non-zero sized partitions
+ assert(nonEmptyBlocks.size <= 4)
+ }
+
}
object ShuffleSuite {