Skip to content

Commit

Permalink
Fix a failing test (seems to be due to change in SizeTracker logic)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateiz committed Jul 30, 2014
1 parent 9464d5f commit f617432
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.util.Comparator
* Append-only buffer of key-value pairs that keeps track of its estimated size in bytes.
*/
private[spark] class SizeTrackingPairBuffer[K, V](initialCapacity: Int = 64)
extends SizeTrackingPairCollection[K, V] with SizeTracker
extends SizeTracker with SizeTrackingPairCollection[K, V]
{
require(initialCapacity <= (1 << 29), "Can't make capacity bigger than 2^29 elements")
require(initialCapacity >= 1, "Invalid initial capacity")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class ExternalSorterSuite extends FunSuite with LocalSparkContext {

val agg = new Aggregator[Int, Int, Int](i => i, (i, j) => i + j, (i, j) => i + j)
val ord = implicitly[Ordering[Int]]
val elements = Iterator((1, 1), (5, 5)) ++ (0 until 50000).iterator.map(x => (2, 2))
val elements = Iterator((1, 1), (5, 5)) ++ (0 until 100000).iterator.map(x => (2, 2))

val sorter = new ExternalSorter[Int, Int, Int](
None, Some(new HashPartitioner(7)), None, None)
Expand All @@ -118,7 +118,7 @@ class ExternalSorterSuite extends FunSuite with LocalSparkContext {
val iter = sorter.partitionedIterator.map(p => (p._1, p._2.toList))
assert(iter.next() === (0, Nil))
assert(iter.next() === (1, List((1, 1))))
assert(iter.next() === (2, (0 until 50000).map(x => (2, 2)).toList))
assert(iter.next() === (2, (0 until 100000).map(x => (2, 2)).toList))
assert(iter.next() === (3, Nil))
assert(iter.next() === (4, Nil))
assert(iter.next() === (5, List((5, 5))))
Expand Down

0 comments on commit f617432

Please sign in to comment.