spark-instrumented-optimizer/common
jerryshao e1960c3d6f [SPARK-22062][CORE] Spill large block to disk in BlockManager's remote fetch to avoid OOM
## What changes were proposed in this pull request?

In the current BlockManager's `getRemoteBytes`, it will call `BlockTransferService#fetchBlockSync` to get remote block. In the `fetchBlockSync`, Spark will allocate a temporary `ByteBuffer` to store the whole fetched block. This will potentially lead to OOM if block size is too big or several blocks are fetched simultaneously in this executor.

So here leveraging the idea of shuffle fetch, to spill the large block to local disk before consumed by upstream code. The behavior is controlled by newly added configuration, if block size is smaller than the threshold, then this block will be persisted in memory; otherwise it will first spill to disk, and then read from disk file.

To achieve this feature, what I did is:

1. Rename `TempShuffleFileManager` to `TempFileManager`, since now it is not only used by shuffle.
2. Add a new `TempFileManager` to manage the files of fetched remote blocks, the files are tracked by weak reference, will be deleted when no use at all.

## How was this patch tested?

This was tested by adding UT, also manual verification in local test to perform GC to clean the files.

Author: jerryshao <sshao@hortonworks.com>

Closes #19476 from jerryshao/SPARK-22062.
2017-10-17 22:54:38 +08:00
..
kvstore [SPARK-20642][CORE] Store FsHistoryProvider listing data in a KVStore. 2017-09-27 20:33:41 +08:00
network-common [SPARK-22066][BUILD] Update checkstyle to 8.2, enable it, fix violations 2017-09-20 10:01:46 +01:00
network-shuffle [SPARK-22062][CORE] Spill large block to disk in BlockManager's remote fetch to avoid OOM 2017-10-17 22:54:38 +08:00
network-yarn [SPARK-17321][YARN] Avoid writing shuffle metadata to disk if NM recovery is disabled 2017-08-31 09:26:20 +08:00
sketch [SPARK-22066][BUILD] Update checkstyle to 8.2, enable it, fix violations 2017-09-20 10:01:46 +01:00
tags [SPARK-20453] Bump master branch version to 2.3.0-SNAPSHOT 2017-04-24 21:48:04 -07:00
unsafe [SPARK-22222][CORE] Fix the ARRAY_MAX in BufferHolder and add a test 2017-10-09 21:34:37 -07:00