spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiszk <...@git.apache.org>
Subject [GitHub] spark pull request #19222: [SPARK-10399][CORE][SQL] Introduce multiple Memor...
Date Mon, 26 Feb 2018 08:26:12 GMT
Github user kiszk commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19222#discussion_r170519540
  
    --- Diff: common/unsafe/src/main/java/org/apache/spark/unsafe/memory/UnsafeMemoryAllocator.java
---
    @@ -19,15 +19,24 @@
     
     import org.apache.spark.unsafe.Platform;
     
    +import java.lang.reflect.InvocationTargetException;
    +import java.lang.reflect.Method;
    +import java.nio.ByteBuffer;
    +
    +import sun.nio.ch.DirectBuffer;
    +
     /**
      * A simple {@link MemoryAllocator} that uses {@code Unsafe} to allocate off-heap memory.
      */
     public class UnsafeMemoryAllocator implements MemoryAllocator {
     
       @Override
    -  public MemoryBlock allocate(long size) throws OutOfMemoryError {
    +  public OffHeapMemoryBlock allocate(long size) throws OutOfMemoryError {
    +    // No usage of DirectByteBuffer.allocateDirect is current design
    --- End diff --
    
    Since previous implementation used `DirectByteBuffer.allocateDirect`, I leave a reference
for my decision. I will remove this.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message