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/11/09 01:56:22 UTC

[05/10] git commit: DRILL-271 release buffer in VectorAccessibleSerializable read. Also read directly from stream.

DRILL-271 release buffer in VectorAccessibleSerializable read. Also read directly from stream.


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

Branch: refs/heads/master
Commit: 90c302def50ca74e7c4c2b2c40a75a8250f4df00
Parents: d529352
Author: Steven Phillips <sp...@maprtech.com>
Authored: Wed Oct 30 11:25:10 2013 -0700
Committer: Steven Phillips <sp...@maprtech.com>
Committed: Thu Oct 31 17:34:42 2013 -0700

----------------------------------------------------------------------
 .../apache/drill/exec/cache/VectorAccessibleSerializable.java   | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/90c302de/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java b/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
index 24387d8..f4a6998 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/cache/VectorAccessibleSerializable.java
@@ -87,13 +87,12 @@ public class VectorAccessibleSerializable implements DrillSerializable {
     List<FieldMetadata> fieldList = batchDef.getFieldList();
     for (FieldMetadata metaData : fieldList) {
       int dataLength = metaData.getBufferLength();
-      byte[] bytes = new byte[dataLength];
-      input.read(bytes);
       MaterializedField field = MaterializedField.create(metaData.getDef());
       ByteBuf buf = allocator.buffer(dataLength);
-      buf.setBytes(0, bytes);
+      buf.writeBytes(input, dataLength);
       ValueVector vector = TypeHelper.getNewVector(field, allocator);
       vector.load(metaData, buf);
+      buf.release();
       vectorList.add(vector);
     }
     container.addCollection(vectorList);