Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/1799#discussion_r15898996
--- Diff:
core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala ---
@@ -120,6 +128,18 @@ private[spark] class ExternalSorter[K, V, C](
// How much of the shared memory pool this collection has claimed
private var myMemoryThreshold = 0L
+ // If there are fewer than spark.shuffle.sort.bypassMergeThreshold
partitions and we don't need
+ // local aggregation and sorting, write numPartitions files directly and
just concatenate them
+ // at the end. This avoids doing serialization and deserialization twice
to merge together the
+ // spilled files, which would happen with the normal code path. The
downside is having multiple
+ // files open at a time and thus more memory allocated to buffers.
+ private val bypassMergeThreshold =
conf.getInt("spark.shuffle.sort.bypassMergeThreshold", 200)
+ private[collection] val bypassMergeSort = //
private[collection] for unit tests
--- End diff --
You can use this in unit test:
http://doc.scalatest.org/1.4.1/org/scalatest/PrivateMethodTester.html
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]