diff options
author | Dmitriy Lyubimov <dlyubimov@apache.org> | 2013-07-31 19:27:30 -0700 |
---|---|---|
committer | Dmitriy Lyubimov <dlyubimov@apache.org> | 2013-07-31 19:27:30 -0700 |
commit | 7c52ecc6a44d6898858c368a4857bdc89c2a5c2d (patch) | |
tree | 017a5b6bee96e56f1670739d39a4a25f6a0b4d79 /core/src/test | |
parent | 96664431cb55136b0a067e5782a1f6656144f1f4 (diff) | |
download | spark-7c52ecc6a44d6898858c368a4857bdc89c2a5c2d.tar.gz spark-7c52ecc6a44d6898858c368a4857bdc89c2a5c2d.tar.bz2 spark-7c52ecc6a44d6898858c368a4857bdc89c2a5c2d.zip |
(1) added reduce test case.
(2) added nested streaming in ParallelCollectionRDD
(3) added kryo with fold test which still doesn't work
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/scala/spark/KryoSerializerSuite.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/test/scala/spark/KryoSerializerSuite.scala b/core/src/test/scala/spark/KryoSerializerSuite.scala index 158bf63132..9a667bd2fb 100644 --- a/core/src/test/scala/spark/KryoSerializerSuite.scala +++ b/core/src/test/scala/spark/KryoSerializerSuite.scala @@ -140,6 +140,21 @@ class KryoSerializerSuite extends FunSuite with SharedSparkContext { assert (control === result.toSeq) } + test("kryo with reduce") { + val control = 1 :: 2 :: Nil + val result = sc.parallelize(control, 2).map(new ClassWithoutNoArgConstructor(_)) + .reduce((t1, t2) => new ClassWithoutNoArgConstructor(t1.x + t2.x)).x + assert(control.sum === result) + } + + // TODO: this still doesn't work +// test("kryo with fold") { +// val control = 1 :: 2 :: Nil +// val result = sc.parallelize(control, 2).map(new ClassWithoutNoArgConstructor(_)) +// .fold(new ClassWithoutNoArgConstructor(10))((t1, t2) => new ClassWithoutNoArgConstructor(t1.x + t2.x)).x +// assert(10 + control.sum === result) +// } + override def beforeAll() { System.setProperty("spark.serializer", "spark.KryoSerializer") System.setProperty("spark.kryo.registrator", classOf[MyRegistrator].getName) |