diff options
author | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-09-26 00:25:34 -0700 |
---|---|---|
committer | Matei Zaharia <matei@eecs.berkeley.edu> | 2012-09-26 00:25:34 -0700 |
commit | d71a358c4619037053e7f723568282f52c2ad2e0 (patch) | |
tree | cff75cf56568247490497859b83870ab92acb862 /core/src/main/scala/spark/ShuffledRDD.scala | |
parent | d51d5e0582c0605deae7497cd95a055698dc9383 (diff) | |
download | spark-d71a358c4619037053e7f723568282f52c2ad2e0.tar.gz spark-d71a358c4619037053e7f723568282f52c2ad2e0.tar.bz2 spark-d71a358c4619037053e7f723568282f52c2ad2e0.zip |
Fixed a test that was getting extremely lucky before, and increased the
number of samples used for sorting
Diffstat (limited to 'core/src/main/scala/spark/ShuffledRDD.scala')
-rw-r--r-- | core/src/main/scala/spark/ShuffledRDD.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/scala/spark/ShuffledRDD.scala b/core/src/main/scala/spark/ShuffledRDD.scala index a7346060b3..be75890a40 100644 --- a/core/src/main/scala/spark/ShuffledRDD.scala +++ b/core/src/main/scala/spark/ShuffledRDD.scala @@ -71,7 +71,11 @@ class ShuffledSortedRDD[K <% Ordered[K]: ClassManifest, V]( val buf = new ArrayBuffer[(K, V)] def addTupleToBuffer(k: K, v: V) = { buf += Tuple(k, v) } SparkEnv.get.shuffleFetcher.fetch[K, V](dep.shuffleId, split.index, addTupleToBuffer) - buf.sortWith((x, y) => if (ascending) x._1 < y._1 else x._1 > y._1).iterator + if (ascending) { + buf.sortWith((x, y) => x._1 < y._1).iterator + } else { + buf.sortWith((x, y) => x._1 > y._1).iterator + } } } |