DRILL-1207: Use similar initial allocation size in ObjectVector as used by other vectors
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/4c910946 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/4c910946 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/4c910946 Branch: refs/heads/master Commit: 4c91094671ed7b018a1d2ebf3a05871bfd6a10ed Parents: 07483f2 Author: Mehant Baid <[email protected]> Authored: Mon Aug 4 23:29:36 2014 -0700 Committer: Jacques Nadeau <[email protected]> Committed: Wed Aug 6 16:44:21 2014 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/drill/exec/vector/ObjectVector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/4c910946/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ObjectVector.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ObjectVector.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ObjectVector.java index 25aff57..650f5ae 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ObjectVector.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ObjectVector.java @@ -37,7 +37,7 @@ public class ObjectVector extends BaseValueVector{ private Mutator mutator = new Mutator(); private int maxCount = 0; private int count = 0; - private int allocationSize = 4024; + private int allocationSize = 4096; private List<Object[]> objectArrayList = new ArrayList<>(); @@ -54,7 +54,7 @@ public class ObjectVector extends BaseValueVector{ public void set(int index, Object obj) { int listOffset = index / allocationSize; - if (listOffset > objectArrayList.size()) { + if (listOffset >= objectArrayList.size()) { addNewArray(); } objectArrayList.get(listOffset)[index % allocationSize] = obj; @@ -193,7 +193,7 @@ public class ObjectVector extends BaseValueVector{ @Override public Object getObject(int index) { int listOffset = index / allocationSize; - if (listOffset > objectArrayList.size()) { + if (listOffset >= objectArrayList.size()) { addNewArray(); } return objectArrayList.get(listOffset)[index % allocationSize];
