[ 
https://issues.apache.org/jira/browse/DRILL-6002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16299386#comment-16299386
 ] 

ASF GitHub Bot commented on DRILL-6002:
---------------------------------------

Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1058#discussion_r158180993
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorSerializer.java 
---
    @@ -40,20 +52,18 @@
        */
     
       public static class Writer {
    +    static final MetricRegistry metrics = DrillMetrics.getRegistry();
    +    static final String WRITER_TIMER = 
MetricRegistry.name(VectorAccessibleSerializable.class, "writerTime");
     
    -    private final OutputStream stream;
    -    private final BufferAllocator allocator;
    -    private boolean retain;
    +    private final SpillSet spillSet;
    +    private final WritableByteChannel channel;
    +    private final OutputStream output;
         private long timeNs;
     
    -    public Writer(BufferAllocator allocator, OutputStream stream) {
    -      this.allocator = allocator;
    -      this.stream = stream;
    -    }
    -
    -    public Writer retain() {
    -      retain = true;
    -      return this;
    +    private Writer(SpillSet spillSet, String path) throws IOException {
    --- End diff --
    
    The `Writer` is a wrapper to make `VectorSerializer` easier to use. It is 
*presently* only used in spilling (that's the project that created it.) But, 
the intention is for it to be general purpose. By binding int to `SpillSet`, it 
then becomes the easy-to-use interface for spilling, but other code must use 
the clunkier prior interface.
    
    Not a big issue; just trying to pass along the design intent when the code 
was created...


> Avoid memory copy from direct buffer to heap while spilling to local disk
> -------------------------------------------------------------------------
>
>                 Key: DRILL-6002
>                 URL: https://issues.apache.org/jira/browse/DRILL-6002
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Vlad Rozov
>            Assignee: Vlad Rozov
>
> When spilling to a local disk or to any file system that supports 
> WritableByteChannel it is preferable to avoid copy from off-heap to java heap 
> as WritableByteChannel can work directly with the off-heap memory.  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to