GitHub user kiszk opened a pull request: https://github.com/apache/spark/pull/19222
[SPARK-10399][CORE][SQL] Introduce multiple MemoryBlocks to choose several types of memory block ## What changes were proposed in this pull request? This PR allows us to use one of several types of `MemoryBlock`, such as byte array, int array, long array, or `java.nio.DirectByteBuffer`. To use `java.nio.DirectByteBuffer` allows to have off heap memory which is automatically deallocated by JVM. `spark.unsafe.Platform` interface refactored from indefinite Objects, to MemoryBlocks and arrays of primitives. This PR uses `MemoryBlock` for `OffHeapColumnVector`, `UTF8String`, and other places. For now, this PR does not use `MemoryBlock` for `BufferHolder` based on @cloud-fan's [suggestion](https://github.com/apache/spark/pull/11494#issuecomment-309694290). Many codes were ported from #11494. Many efforts were put here. I think this PR should credit to @yzotov. ## How was this patch tested? Existing tests You can merge this pull request into a Git repository by running: $ git pull https://github.com/kiszk/spark SPARK-10399 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/spark/pull/19222.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19222 ---- commit c2aa3b0d353cf850a79fb58891a7ad56a25f72cf Author: Kazuaki Ishizaki <ishiz...@jp.ibm.com> Date: 2017-09-13T10:16:19Z introduce ByteArrayMemoryBlock, IntArrayMemoryBlock, LongArrayMemoryBlock, and OffheaMemoryBlock commit e7fb6593a688dbfedbc9708bc0bf2d297509eb31 Author: Kazuaki Ishizaki <ishiz...@jp.ibm.com> Date: 2017-09-13T17:15:25Z OffHeapColumnVector uses UnsafeMemoryAllocator commit 2307f32e24aa8c4375d5bce4631bdb18fd70659e Author: Kazuaki Ishizaki <ishiz...@jp.ibm.com> Date: 2017-09-13T17:27:09Z UTF8String uses UnsafeMemoryAllocator commit b7ffa10e7fe359dd3efdae3d54d87db215ce0958 Author: Kazuaki Ishizaki <ishiz...@jp.ibm.com> Date: 2017-09-13T17:36:57Z Platform.copymemory() in UsafeInMemorySorter uses new MemoryBlock ---- --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org