You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by ja...@apache.org on 2013/08/16 03:44:44 UTC

[06/27] git commit: Fix VarLen getBuffers template and retain

Fix VarLen getBuffers template and retain


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/0a327ede
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/0a327ede
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/0a327ede

Branch: refs/heads/master
Commit: 0a327ede37cc3e712a6bf3729f52d0563ac78275
Parents: 6f9dadb
Author: Timothy Chen <tn...@gmail.com>
Authored: Tue Aug 13 21:06:50 2013 -0700
Committer: Timothy Chen <tn...@gmail.com>
Committed: Tue Aug 13 21:06:50 2013 -0700

----------------------------------------------------------------------
 .../codegen/ValueVectors/templates/VariableLengthVectors.java     | 3 ++-
 .../java/org/apache/drill/exec/vector/BaseDataValueVector.java    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/0a327ede/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
index 4492aa9..061234c 100644
--- a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
+++ b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
@@ -14,6 +14,7 @@ import java.io.Closeable;
 import java.nio.ByteBuffer;
 import java.util.Random;
 
+import org.apache.commons.lang3.ArrayUtils;
 import org.apache.drill.exec.memory.BufferAllocator;
 import org.apache.drill.exec.proto.SchemaDefProtos;
 import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
@@ -107,7 +108,7 @@ public final class ${minor.class}Vector extends BaseDataValueVector implements V
 
   @Override
   public ByteBuf[] getBuffers() {
-    return new ByteBuf[]{offsetVector.data, this.data};
+    return ArrayUtils.addAll(offsetVector.getBuffers(), super.getBuffers());
   }
   
   public TransferPair getTransferPair(){

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/0a327ede/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
index 1b1e39a..4bfab47 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
@@ -34,6 +34,7 @@ abstract class BaseDataValueVector extends BaseValueVector{
   public ByteBuf[] getBuffers(){
     ByteBuf[] out = new ByteBuf[]{data};
     data.readerIndex(0);
+    data.retain();
     clear();
     return out;
   }