-
- Downloads
Merge pull request #377 from andrewor14/master
External Sorting for Aggregator and CoGroupedRDDs (Revisited) (This pull request is re-opened from https://github.com/apache/incubator-spark/pull/303, which was closed because Jenkins / github was misbehaving) The target issue for this patch is the out-of-memory exceptions triggered by aggregate operations such as reduce, groupBy, join, and cogroup. The existing AppendOnlyMap used by these operations resides purely in memory, and grows with the size of the input data until the amount of allocated memory is exceeded. Under large workloads, this problem is aggravated by the fact that OOM frequently occurs only after a very long (> 1 hour) map phase, in which case the entire job must be restarted. The solution is to spill the contents of this map to disk once a certain memory threshold is exceeded. This functionality is provided by ExternalAppendOnlyMap, which additionally sorts this buffer before writing it out to disk, and later merges these buffers back in sorted order. Under normal circumstances in which OOM is not triggered, ExternalAppendOnlyMap is simply a wrapper around AppendOnlyMap and incurs little overhead. Only when the memory usage is expected to exceed the given threshold does ExternalAppendOnlyMap spill to disk.
No related branches found
No related tags found
Showing
- core/src/main/scala/org/apache/spark/Aggregator.scala 41 additions, 20 deletionscore/src/main/scala/org/apache/spark/Aggregator.scala
- core/src/main/scala/org/apache/spark/SparkEnv.scala 5 additions, 1 deletioncore/src/main/scala/org/apache/spark/SparkEnv.scala
- core/src/main/scala/org/apache/spark/executor/Executor.scala 5 additions, 0 deletionscore/src/main/scala/org/apache/spark/executor/Executor.scala
- core/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala 65 additions, 23 deletionscore/src/main/scala/org/apache/spark/rdd/CoGroupedRDD.scala
- core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala 3 additions, 4 deletions...rc/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala
- core/src/main/scala/org/apache/spark/storage/BlockId.scala 10 additions, 2 deletionscore/src/main/scala/org/apache/spark/storage/BlockId.scala
- core/src/main/scala/org/apache/spark/storage/BlockManager.scala 1 addition, 1 deletion...rc/main/scala/org/apache/spark/storage/BlockManager.scala
- core/src/main/scala/org/apache/spark/storage/BlockObjectWriter.scala 4 additions, 0 deletions...in/scala/org/apache/spark/storage/BlockObjectWriter.scala
- core/src/main/scala/org/apache/spark/storage/DiskBlockManager.scala 10 additions, 1 deletion...ain/scala/org/apache/spark/storage/DiskBlockManager.scala
- core/src/main/scala/org/apache/spark/util/collection/AppendOnlyMap.scala 88 additions, 28 deletions...cala/org/apache/spark/util/collection/AppendOnlyMap.scala
- core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala 350 additions, 0 deletions.../apache/spark/util/collection/ExternalAppendOnlyMap.scala
- core/src/main/scala/org/apache/spark/util/collection/SizeTrackingAppendOnlyMap.scala 101 additions, 0 deletions...che/spark/util/collection/SizeTrackingAppendOnlyMap.scala
- core/src/test/scala/org/apache/spark/util/SizeTrackingAppendOnlyMapSuite.scala 120 additions, 0 deletions...rg/apache/spark/util/SizeTrackingAppendOnlyMapSuite.scala
- core/src/test/scala/org/apache/spark/util/collection/AppendOnlyMapSuite.scala 45 additions, 1 deletion...org/apache/spark/util/collection/AppendOnlyMapSuite.scala
- core/src/test/scala/org/apache/spark/util/collection/ExternalAppendOnlyMapSuite.scala 230 additions, 0 deletions...he/spark/util/collection/ExternalAppendOnlyMapSuite.scala
- docs/configuration.md 21 additions, 2 deletionsdocs/configuration.md
- streaming/src/test/java/org/apache/spark/streaming/JavaAPISuite.java 19 additions, 10 deletions...rc/test/java/org/apache/spark/streaming/JavaAPISuite.java
Loading
Please register or sign in to comment