Skip to content

Commit c71fbc7

Browse files
committed
Open interface back up for testing
1 parent f36edd5 commit c71fbc7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ private[spark] class ExternalSorter[K, V, C](
664664
}
665665

666666
/**
667+
* Exposed for testing purposes.
668+
*
667669
* Return an iterator over all the data written to this object, grouped by partition and
668670
* aggregated by the requested aggregator. For each partition we then have an iterator over its
669671
* contents, and these are expected to be accessed in order (you can't "skip ahead" to one
@@ -673,7 +675,7 @@ private[spark] class ExternalSorter[K, V, C](
673675
* For now, we just merge all the spilled files in once pass, but this can be modified to
674676
* support hierarchical merging.
675677
*/
676-
private def partitionedIterator: Iterator[(Int, Iterator[Product2[K, C]])] = {
678+
def partitionedIterator: Iterator[(Int, Iterator[Product2[K, C]])] = {
677679
val usingMap = aggregator.isDefined
678680
val collection: SizeTrackingPairCollection[(Int, K), C] = if (usingMap) map else buffer
679681
if (spills.isEmpty && partitionWriters == null) {

0 commit comments

Comments
 (0)