drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [11/45] drill git commit: DRILL-3987: (MOVE) Extract key vector, field reader, complex/field writer classes.
Date Fri, 13 Nov 2015 02:37:41 GMT
http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/io/netty/buffer/LargeBuffer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/io/netty/buffer/LargeBuffer.java b/exec/java-exec/src/main/java/io/netty/buffer/LargeBuffer.java
deleted file mode 100644
index f1d4842..0000000
--- a/exec/java-exec/src/main/java/io/netty/buffer/LargeBuffer.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.netty.buffer;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.channels.GatheringByteChannel;
-import java.nio.channels.ScatteringByteChannel;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * This is basically a complete copy of DuplicatedByteBuf. We copy because we can't override the release methods to keep
- * global track of created Large Buffers.
- */
-public class LargeBuffer extends AbstractByteBuf {
-
-  private final AtomicLong hugeBufferSize;
-  private final AtomicLong hugeBufferCount;
-
-  @Override
-  public ByteBuffer nioBuffer(int index, int length) {
-    return unwrap().nioBuffer(index, length);
-  }
-
-  private final ByteBuf buffer;
-  private final int initCap;
-
-  public LargeBuffer(ByteBuf buffer, AtomicLong hugeBufferSize, AtomicLong hugeBufferCount) {
-    super(buffer.maxCapacity());
-    initCap = buffer.capacity();
-    this.hugeBufferCount = hugeBufferCount;
-    this.hugeBufferSize = hugeBufferSize;
-
-    if (buffer instanceof LargeBuffer) {
-      this.buffer = ((LargeBuffer) buffer).buffer;
-    } else {
-      this.buffer = buffer;
-    }
-
-    setIndex(buffer.readerIndex(), buffer.writerIndex());
-  }
-
-  @Override
-  public ByteBuf unwrap() {
-    return buffer;
-  }
-
-  @Override
-  public ByteBufAllocator alloc() {
-    return buffer.alloc();
-  }
-
-  @Override
-  public ByteOrder order() {
-    return buffer.order();
-  }
-
-  @Override
-  public boolean isDirect() {
-    return buffer.isDirect();
-  }
-
-  @Override
-  public int capacity() {
-    return buffer.capacity();
-  }
-
-  @Override
-  public ByteBuf capacity(int newCapacity) {
-    buffer.capacity(newCapacity);
-    return this;
-  }
-
-  @Override
-  public boolean hasArray() {
-    return buffer.hasArray();
-  }
-
-  @Override
-  public byte[] array() {
-    return buffer.array();
-  }
-
-  @Override
-  public int arrayOffset() {
-    return buffer.arrayOffset();
-  }
-
-  @Override
-  public boolean hasMemoryAddress() {
-    return buffer.hasMemoryAddress();
-  }
-
-  @Override
-  public long memoryAddress() {
-    return buffer.memoryAddress();
-  }
-
-  @Override
-  public byte getByte(int index) {
-    return _getByte(index);
-  }
-
-  @Override
-  protected byte _getByte(int index) {
-    return buffer.getByte(index);
-  }
-
-  @Override
-  public short getShort(int index) {
-    return _getShort(index);
-  }
-
-  @Override
-  protected short _getShort(int index) {
-    return buffer.getShort(index);
-  }
-
-  @Override
-  public int getUnsignedMedium(int index) {
-    return _getUnsignedMedium(index);
-  }
-
-  @Override
-  protected int _getUnsignedMedium(int index) {
-    return buffer.getUnsignedMedium(index);
-  }
-
-  @Override
-  public int getInt(int index) {
-    return _getInt(index);
-  }
-
-  @Override
-  protected int _getInt(int index) {
-    return buffer.getInt(index);
-  }
-
-  @Override
-  public long getLong(int index) {
-    return _getLong(index);
-  }
-
-  @Override
-  protected long _getLong(int index) {
-    return buffer.getLong(index);
-  }
-
-  @Override
-  public ByteBuf copy(int index, int length) {
-    return new LargeBuffer(buffer.copy(index, length), hugeBufferSize, hugeBufferCount);
-  }
-
-  @Override
-  public ByteBuf slice(int index, int length) {
-    return new SlicedByteBuf(this, index, length);
-  }
-
-  @Override
-  public ByteBuf getBytes(int index, ByteBuf dst, int dstIndex, int length) {
-    buffer.getBytes(index, dst, dstIndex, length);
-    return this;
-  }
-
-  @Override
-  public ByteBuf getBytes(int index, byte[] dst, int dstIndex, int length) {
-    buffer.getBytes(index, dst, dstIndex, length);
-    return this;
-  }
-
-  @Override
-  public ByteBuf getBytes(int index, ByteBuffer dst) {
-    buffer.getBytes(index, dst);
-    return this;
-  }
-
-  @Override
-  public ByteBuf setByte(int index, int value) {
-    _setByte(index, value);
-    return this;
-  }
-
-  @Override
-  protected void _setByte(int index, int value) {
-    buffer.setByte(index, value);
-  }
-
-  @Override
-  public ByteBuf setShort(int index, int value) {
-    _setShort(index, value);
-    return this;
-  }
-
-  @Override
-  protected void _setShort(int index, int value) {
-    buffer.setShort(index, value);
-  }
-
-  @Override
-  public ByteBuf setMedium(int index, int value) {
-    _setMedium(index, value);
-    return this;
-  }
-
-  @Override
-  protected void _setMedium(int index, int value) {
-    buffer.setMedium(index, value);
-  }
-
-  @Override
-  public ByteBuf setInt(int index, int value) {
-    _setInt(index, value);
-    return this;
-  }
-
-  @Override
-  protected void _setInt(int index, int value) {
-    buffer.setInt(index, value);
-  }
-
-  @Override
-  public ByteBuf setLong(int index, long value) {
-    _setLong(index, value);
-    return this;
-  }
-
-  @Override
-  protected void _setLong(int index, long value) {
-    buffer.setLong(index, value);
-  }
-
-  @Override
-  public ByteBuf setBytes(int index, byte[] src, int srcIndex, int length) {
-    buffer.setBytes(index, src, srcIndex, length);
-    return this;
-  }
-
-  @Override
-  public ByteBuf setBytes(int index, ByteBuf src, int srcIndex, int length) {
-    buffer.setBytes(index, src, srcIndex, length);
-    return this;
-  }
-
-  @Override
-  public ByteBuf setBytes(int index, ByteBuffer src) {
-    buffer.setBytes(index, src);
-    return this;
-  }
-
-  @Override
-  public ByteBuf getBytes(int index, OutputStream out, int length)
-      throws IOException {
-    buffer.getBytes(index, out, length);
-    return this;
-  }
-
-  @Override
-  public int getBytes(int index, GatheringByteChannel out, int length)
-      throws IOException {
-    return buffer.getBytes(index, out, length);
-  }
-
-  @Override
-  public int setBytes(int index, InputStream in, int length)
-      throws IOException {
-    return buffer.setBytes(index, in, length);
-  }
-
-  @Override
-  public int setBytes(int index, ScatteringByteChannel in, int length)
-      throws IOException {
-    return buffer.setBytes(index, in, length);
-  }
-
-  @Override
-  public int nioBufferCount() {
-    return buffer.nioBufferCount();
-  }
-
-  @Override
-  public ByteBuffer[] nioBuffers(int index, int length) {
-    return buffer.nioBuffers(index, length);
-  }
-
-  @Override
-  public ByteBuffer internalNioBuffer(int index, int length) {
-    return nioBuffer(index, length);
-  }
-
-  @Override
-  public int forEachByte(int index, int length, ByteBufProcessor processor) {
-    return buffer.forEachByte(index, length, processor);
-  }
-
-  @Override
-  public int forEachByteDesc(int index, int length, ByteBufProcessor processor) {
-    return buffer.forEachByteDesc(index, length, processor);
-  }
-
-  @Override
-  public final int refCnt() {
-    return unwrap().refCnt();
-  }
-
-  @Override
-  public final ByteBuf retain() {
-    unwrap().retain();
-    return this;
-  }
-
-  @Override
-  public final ByteBuf retain(int increment) {
-    unwrap().retain(increment);
-    return this;
-  }
-
-  @Override
-  public boolean release() {
-    return release(1);
-  }
-
-  @Override
-  public boolean release(int decrement) {
-    boolean released = unwrap().release(decrement);
-    if (released) {
-      hugeBufferSize.addAndGet(-initCap);
-      hugeBufferCount.decrementAndGet();
-    }
-    return released;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java b/exec/java-exec/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
deleted file mode 100644
index 2ca79f0..0000000
--- a/exec/java-exec/src/main/java/io/netty/buffer/PooledByteBufAllocatorL.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.netty.buffer;
-
-import io.netty.util.internal.StringUtil;
-
-import java.lang.reflect.Field;
-import java.nio.ByteBuffer;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.drill.common.exceptions.DrillRuntimeException;
-import org.apache.drill.exec.metrics.DrillMetrics;
-import org.apache.drill.exec.util.AssertionUtil;
-
-import com.codahale.metrics.Gauge;
-import com.codahale.metrics.Histogram;
-import com.codahale.metrics.Metric;
-import com.codahale.metrics.MetricFilter;
-import com.codahale.metrics.MetricRegistry;
-
-public class PooledByteBufAllocatorL extends PooledByteBufAllocator{
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(PooledByteBufAllocatorL.class);
-
-  private static final org.slf4j.Logger memoryLogger = org.slf4j.LoggerFactory.getLogger("drill.allocator");
-  private static final int MEMORY_LOGGER_FREQUENCY_SECONDS = 60;
-
-  private static final String METRIC_PREFIX = "drill.allocator.";
-  public static final PooledByteBufAllocatorL DEFAULT = new PooledByteBufAllocatorL();
-
-  private final MetricRegistry registry = DrillMetrics.getInstance();
-  private final AtomicLong hugeBufferSize = new AtomicLong(0);
-  private final AtomicLong hugeBufferCount = new AtomicLong(0);
-  private final AtomicLong normalBufferSize = new AtomicLong(0);
-  private final AtomicLong normalBufferCount = new AtomicLong(0);
-
-  private final PoolArena<ByteBuffer>[] directArenas;
-  private final MemoryStatusThread statusThread;
-  private final Histogram largeBuffersHist;
-  private final Histogram normalBuffersHist;
-
-  private PooledByteBufAllocatorL() {
-    super(true);
-    try {
-      Field f = PooledByteBufAllocator.class.getDeclaredField("directArenas");
-      f.setAccessible(true);
-      this.directArenas = (PoolArena<ByteBuffer>[]) f.get(this);
-    } catch (Exception e) {
-      throw new RuntimeException("Failure while initializing allocator.  Unable to retrieve direct arenas field.", e);
-    }
-
-    if (memoryLogger.isTraceEnabled()) {
-      statusThread = new MemoryStatusThread();
-      statusThread.start();
-    } else {
-      statusThread = null;
-    }
-    removeOldMetrics();
-
-    registry.register(METRIC_PREFIX + "normal.size", new Gauge<Long>() {
-      @Override
-      public Long getValue() {
-        return normalBufferSize.get();
-      }
-    });
-
-    registry.register(METRIC_PREFIX + "normal.count", new Gauge<Long>() {
-      @Override
-      public Long getValue() {
-        return normalBufferCount.get();
-      }
-    });
-
-    registry.register(METRIC_PREFIX + "huge.size", new Gauge<Long>() {
-      @Override
-      public Long getValue() {
-        return hugeBufferSize.get();
-      }
-    });
-
-    registry.register(METRIC_PREFIX + "huge.count", new Gauge<Long>() {
-      @Override
-      public Long getValue() {
-        return hugeBufferCount.get();
-      }
-    });
-
-    largeBuffersHist = registry.histogram(METRIC_PREFIX + "huge.hist");
-    normalBuffersHist = registry.histogram(METRIC_PREFIX + "normal.hist");
-
-  }
-
-  private synchronized void removeOldMetrics() {
-    registry.removeMatching(new MetricFilter() {
-      @Override
-      public boolean matches(String name, Metric metric) {
-        return name.startsWith("drill.allocator.");
-      }
-    });
-  }
-
-  @Override
-  protected ByteBuf newHeapBuffer(int initialCapacity, int maxCapacity) {
-    throw new UnsupportedOperationException("Drill doesn't support using heap buffers.");
-  }
-
-  @Override
-  protected UnsafeDirectLittleEndian newDirectBuffer(int initialCapacity, int maxCapacity) {
-    PoolThreadCache cache = threadCache.get();
-    PoolArena<ByteBuffer> directArena = cache.directArena;
-
-    if (directArena != null) {
-
-      if (initialCapacity > directArena.chunkSize) {
-        // This is beyond chunk size so we'll allocate separately.
-        ByteBuf buf = UnpooledByteBufAllocator.DEFAULT.directBuffer(initialCapacity, maxCapacity);
-
-        hugeBufferCount.incrementAndGet();
-        hugeBufferSize.addAndGet(buf.capacity());
-        largeBuffersHist.update(buf.capacity());
-        // logger.debug("Allocating huge buffer of size {}", initialCapacity, new Exception());
-        return new UnsafeDirectLittleEndian(new LargeBuffer(buf, hugeBufferSize, hugeBufferCount));
-
-      } else {
-        // within chunk, use arena.
-        ByteBuf buf = directArena.allocate(cache, initialCapacity, maxCapacity);
-        if (!(buf instanceof PooledUnsafeDirectByteBuf)) {
-          fail();
-        }
-
-        normalBuffersHist.update(buf.capacity());
-        if (AssertionUtil.ASSERT_ENABLED) {
-          normalBufferSize.addAndGet(buf.capacity());
-          normalBufferCount.incrementAndGet();
-        }
-
-        return new UnsafeDirectLittleEndian((PooledUnsafeDirectByteBuf) buf, normalBufferCount, normalBufferSize);
-      }
-
-    } else {
-      throw fail();
-    }
-  }
-
-  private UnsupportedOperationException fail() {
-    return new UnsupportedOperationException(
-        "Drill requries that the JVM used supports access sun.misc.Unsafe.  This platform didn't provide that functionality.");
-  }
-
-
-  @Override
-  public UnsafeDirectLittleEndian directBuffer(int initialCapacity, int maxCapacity) {
-      if (initialCapacity == 0 && maxCapacity == 0) {
-          newDirectBuffer(initialCapacity, maxCapacity);
-      }
-      validate(initialCapacity, maxCapacity);
-      return newDirectBuffer(initialCapacity, maxCapacity);
-  }
-
-  @Override
-  public ByteBuf heapBuffer(int initialCapacity, int maxCapacity) {
-    throw new UnsupportedOperationException("Drill doesn't support using heap buffers.");
-  }
-
-
-  private static void validate(int initialCapacity, int maxCapacity) {
-    if (initialCapacity < 0) {
-        throw new IllegalArgumentException("initialCapacity: " + initialCapacity + " (expectd: 0+)");
-    }
-    if (initialCapacity > maxCapacity) {
-        throw new IllegalArgumentException(String.format(
-                "initialCapacity: %d (expected: not greater than maxCapacity(%d)",
-                initialCapacity, maxCapacity));
-    }
-  }
-
-  private class MemoryStatusThread extends Thread {
-
-    public MemoryStatusThread() {
-      super("memory-status-logger");
-      this.setDaemon(true);
-      this.setName("allocation.logger");
-    }
-
-    @Override
-    public void run() {
-      while (true) {
-        memoryLogger.trace("Memory Usage: \n{}", PooledByteBufAllocatorL.this.toString());
-        try {
-          Thread.sleep(MEMORY_LOGGER_FREQUENCY_SECONDS * 1000);
-        } catch (InterruptedException e) {
-          return;
-        }
-
-      }
-    }
-
-  }
-
-  public void checkAndReset() {
-    if (hugeBufferCount.get() != 0 || normalBufferCount.get() != 0) {
-      StringBuilder buf = new StringBuilder();
-      buf.append("Large buffers outstanding: ");
-      buf.append(hugeBufferCount.get());
-      buf.append(" totaling ");
-      buf.append(hugeBufferSize.get());
-      buf.append(" bytes.");
-      buf.append('\n');
-      buf.append("Normal buffers outstanding: ");
-      buf.append(normalBufferCount.get());
-      buf.append(" totaling ");
-      buf.append(normalBufferSize.get());
-      buf.append(" bytes.");
-      hugeBufferCount.set(0);
-      normalBufferCount.set(0);
-      hugeBufferSize.set(0);
-      normalBufferSize.set(0);
-      throw new DrillRuntimeException(buf.toString());
-    }
-  }
-
-  public String toString() {
-    StringBuilder buf = new StringBuilder();
-    buf.append(directArenas.length);
-    buf.append(" direct arena(s):");
-    buf.append(StringUtil.NEWLINE);
-    for (PoolArena<ByteBuffer> a : directArenas) {
-      buf.append(a);
-    }
-
-    buf.append("Large buffers outstanding: ");
-    buf.append(this.hugeBufferCount.get());
-    buf.append(" totaling ");
-    buf.append(this.hugeBufferSize.get());
-    buf.append(" bytes.");
-    buf.append('\n');
-    buf.append("Normal buffers outstanding: ");
-    buf.append(this.normalBufferCount.get());
-    buf.append(" totaling ");
-    buf.append(this.normalBufferSize.get());
-    buf.append(" bytes.");
-    return buf.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java b/exec/java-exec/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
deleted file mode 100644
index e332b13..0000000
--- a/exec/java-exec/src/main/java/io/netty/buffer/UnsafeDirectLittleEndian.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package io.netty.buffer;
-
-import io.netty.util.internal.PlatformDependent;
-
-import java.nio.ByteOrder;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.drill.exec.util.AssertionUtil;
-
-public final class UnsafeDirectLittleEndian extends WrappedByteBuf {
-    private static final boolean NATIVE_ORDER = ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN;
-  private final AbstractByteBuf wrapped;
-  private final long memoryAddress;
-  private AtomicLong bufferCount;
-  private AtomicLong bufferSize;
-  private long initCap = -1;
-
-  UnsafeDirectLittleEndian(LargeBuffer buf) {
-    this(buf, true);
-  }
-
-  UnsafeDirectLittleEndian(PooledUnsafeDirectByteBuf buf, AtomicLong bufferCount, AtomicLong bufferSize) {
-    this(buf, true);
-    this.bufferCount = bufferCount;
-    this.bufferSize = bufferSize;
-
-    // initCap is used if we're tracking memory release. If we're in non-debug mode, we'll skip this.
-    this.initCap = AssertionUtil.ASSERT_ENABLED ? capacity() : -1;
-  }
-
-  private UnsafeDirectLittleEndian(AbstractByteBuf buf, boolean fake) {
-    super(buf);
-    if (!NATIVE_ORDER || buf.order() != ByteOrder.BIG_ENDIAN) {
-      throw new IllegalStateException("Drill only runs on LittleEndian systems.");
-    }
-    wrapped = buf;
-    this.memoryAddress = buf.memoryAddress();
-  }
-    private long addr(int index) {
-        return memoryAddress + index;
-    }
-
-    @Override
-    public long getLong(int index) {
-//        wrapped.checkIndex(index, 8);
-        long v = PlatformDependent.getLong(addr(index));
-        return v;
-    }
-
-    @Override
-    public float getFloat(int index) {
-        return Float.intBitsToFloat(getInt(index));
-    }
-
-  @Override
-  public ByteBuf slice() {
-    return slice(this.readerIndex(), readableBytes());
-  }
-
-  @Override
-  public ByteBuf slice(int index, int length) {
-    return new SlicedByteBuf(this, index, length);
-  }
-
-  @Override
-  public ByteOrder order() {
-    return ByteOrder.LITTLE_ENDIAN;
-  }
-
-  @Override
-  public ByteBuf order(ByteOrder endianness) {
-    return this;
-  }
-
-  @Override
-    public double getDouble(int index) {
-        return Double.longBitsToDouble(getLong(index));
-    }
-
-    @Override
-    public char getChar(int index) {
-        return (char) getShort(index);
-    }
-
-    @Override
-    public long getUnsignedInt(int index) {
-        return getInt(index) & 0xFFFFFFFFL;
-    }
-
-    @Override
-    public int getInt(int index) {
-//        wrapped.checkIndex(index, 4);
-        int v = PlatformDependent.getInt(addr(index));
-        return v;
-    }
-
-    @Override
-    public int getUnsignedShort(int index) {
-        return getShort(index) & 0xFFFF;
-    }
-
-    @Override
-    public short getShort(int index) {
-//        wrapped.checkIndex(index, 2);
-        short v = PlatformDependent.getShort(addr(index));
-        return v;
-    }
-
-    @Override
-    public ByteBuf setShort(int index, int value) {
-        wrapped.checkIndex(index, 2);
-        _setShort(index, value);
-        return this;
-    }
-
-    @Override
-    public ByteBuf setInt(int index, int value) {
-        wrapped.checkIndex(index, 4);
-        _setInt(index, value);
-        return this;
-    }
-
-    @Override
-    public ByteBuf setLong(int index, long value) {
-        wrapped.checkIndex(index, 8);
-        _setLong(index, value);
-        return this;
-    }
-
-    @Override
-    public ByteBuf setChar(int index, int value) {
-        setShort(index, value);
-        return this;
-    }
-
-    @Override
-    public ByteBuf setFloat(int index, float value) {
-        setInt(index, Float.floatToRawIntBits(value));
-        return this;
-    }
-
-    @Override
-    public ByteBuf setDouble(int index, double value) {
-        setLong(index, Double.doubleToRawLongBits(value));
-        return this;
-    }
-
-    @Override
-    public ByteBuf writeShort(int value) {
-        wrapped.ensureWritable(2);
-        _setShort(wrapped.writerIndex, value);
-        wrapped.writerIndex += 2;
-        return this;
-    }
-
-    @Override
-    public ByteBuf writeInt(int value) {
-        wrapped.ensureWritable(4);
-        _setInt(wrapped.writerIndex, value);
-        wrapped.writerIndex += 4;
-        return this;
-    }
-
-    @Override
-    public ByteBuf writeLong(long value) {
-        wrapped.ensureWritable(8);
-        _setLong(wrapped.writerIndex, value);
-        wrapped.writerIndex += 8;
-        return this;
-    }
-
-    @Override
-    public ByteBuf writeChar(int value) {
-        writeShort(value);
-        return this;
-    }
-
-    @Override
-    public ByteBuf writeFloat(float value) {
-        writeInt(Float.floatToRawIntBits(value));
-        return this;
-    }
-
-    @Override
-    public ByteBuf writeDouble(double value) {
-        writeLong(Double.doubleToRawLongBits(value));
-        return this;
-    }
-
-    private void _setShort(int index, int value) {
-        PlatformDependent.putShort(addr(index), (short) value);
-    }
-
-    private void _setInt(int index, int value) {
-        PlatformDependent.putInt(addr(index), value);
-    }
-
-    private void _setLong(int index, long value) {
-        PlatformDependent.putLong(addr(index), value);
-    }
-
-    @Override
-    public byte getByte(int index) {
-      return PlatformDependent.getByte(addr(index));
-    }
-
-    @Override
-    public ByteBuf setByte(int index, int value) {
-      PlatformDependent.putByte(addr(index), (byte) value);
-      return this;
-    }
-
-  @Override
-  public boolean release() {
-    return release(1);
-  }
-
-  @Override
-  public boolean release(int decrement) {
-    boolean released = super.release(decrement);
-    if (released && initCap != -1) {
-      bufferCount.decrementAndGet();
-      bufferSize.addAndGet(-initCap);
-    }
-    return released;
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/exception/OversizedAllocationException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/OversizedAllocationException.java b/exec/java-exec/src/main/java/org/apache/drill/exec/exception/OversizedAllocationException.java
deleted file mode 100644
index f5ae70c..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/OversizedAllocationException.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.exception;
-
-import org.apache.drill.common.exceptions.DrillRuntimeException;
-import org.apache.drill.exec.record.RecordBatch;
-
-/**
- * An exception that is used to signal that allocation request in bytes is greater than the maximum allowed by
- * {@link org.apache.drill.exec.memory.BufferAllocator#buffer(int) allocator}.
- *
- * <p>Operators should handle this exception to split the batch and later resume the execution on the next
- * {@link RecordBatch#next() iteration}.</p>
- *
- */
-public class OversizedAllocationException extends DrillRuntimeException {
-  public OversizedAllocationException() {
-    super();
-  }
-
-  public OversizedAllocationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-  }
-
-  public OversizedAllocationException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public OversizedAllocationException(String message) {
-    super(message);
-  }
-
-  public OversizedAllocationException(Throwable cause) {
-    super(cause);
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/exception/SchemaChangeRuntimeException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/SchemaChangeRuntimeException.java b/exec/java-exec/src/main/java/org/apache/drill/exec/exception/SchemaChangeRuntimeException.java
deleted file mode 100644
index f2a7e63..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/exception/SchemaChangeRuntimeException.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.exception;
-
-import org.apache.drill.common.exceptions.DrillRuntimeException;
-
-public class SchemaChangeRuntimeException extends DrillRuntimeException {
-  public SchemaChangeRuntimeException() {
-    super();
-  }
-
-  public SchemaChangeRuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-  }
-
-  public SchemaChangeRuntimeException(String message, Throwable cause) {
-    super(message, cause);
-  }
-
-  public SchemaChangeRuntimeException(String message) {
-    super(message);
-  }
-
-  public SchemaChangeRuntimeException(Throwable cause) {
-    super(cause);
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ComplexHolder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ComplexHolder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ComplexHolder.java
deleted file mode 100644
index e1025df..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ComplexHolder.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.expr.holders;
-
-import org.apache.drill.exec.vector.complex.reader.FieldReader;
-
-public class ComplexHolder implements ValueHolder {
-  public FieldReader reader;
-  public int isSet;
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ObjectHolder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ObjectHolder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ObjectHolder.java
deleted file mode 100644
index 391a795..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ObjectHolder.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.drill.exec.expr.holders;
-
-import org.apache.drill.common.types.TypeProtos;
-import org.apache.drill.common.types.Types;
-
-/*
- * Holder class for the vector ObjectVector. This holder internally stores a
- * reference to an object. The ObjectVector maintains an array of these objects.
- * This holder can be used only as workspace variables in aggregate functions.
- * Using this holder should be avoided and we should stick to native holder types.
- */
-@Deprecated
-public class ObjectHolder implements ValueHolder {
-  public static final TypeProtos.MajorType TYPE = Types.required(TypeProtos.MinorType.GENERIC_OBJECT);
-
-  public TypeProtos.MajorType getType() {return TYPE;}
-
-  public Object obj;
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedListHolder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedListHolder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedListHolder.java
deleted file mode 100644
index 09746da..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedListHolder.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.expr.holders;
-
-public final class RepeatedListHolder implements ValueHolder{
-  public int start;
-  public int end;
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedMapHolder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedMapHolder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedMapHolder.java
deleted file mode 100644
index 247f75e..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/RepeatedMapHolder.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.expr.holders;
-
-public final class RepeatedMapHolder implements ValueHolder{
-  public int start;
-  public int end;
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/UnionHolder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/UnionHolder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/UnionHolder.java
deleted file mode 100644
index 84cdefb..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/UnionHolder.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.expr.holders;
-
-import org.apache.drill.common.types.TypeProtos.MajorType;
-import org.apache.drill.common.types.TypeProtos.MinorType;
-import org.apache.drill.common.types.Types;
-import org.apache.drill.exec.vector.complex.reader.FieldReader;
-
-public class UnionHolder implements ValueHolder {
-  public static final MajorType TYPE = Types.optional(MinorType.UNION);
-  public FieldReader reader;
-  public int isSet;
-
-  public MajorType getType() {
-    return reader.getType();
-  }
-
-  public boolean isSet() {
-    return isSet == 1;
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ValueHolder.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ValueHolder.java b/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ValueHolder.java
deleted file mode 100644
index 2431dcb..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/expr/holders/ValueHolder.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.expr.holders;
-
-/**
- * Wrapper object for an individual value in Drill.
- *
- * ValueHolders are designed to be mutable wrapper objects for defining clean
- * APIs that access data in Drill. For performance, object creation is avoided
- * at all costs throughout execution. For this reason, ValueHolders are
- * disallowed from implementing any methods, this allows for them to be
- * replaced by their java primitive inner members during optimization of
- * run-time generated code.
- */
-public interface ValueHolder {
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/memory/BufferAllocator.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/memory/BufferAllocator.java b/exec/java-exec/src/main/java/org/apache/drill/exec/memory/BufferAllocator.java
deleted file mode 100644
index b01534e..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/memory/BufferAllocator.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.memory;
-
-import io.netty.buffer.ByteBufAllocator;
-import io.netty.buffer.DrillBuf;
-import io.netty.buffer.UnsafeDirectLittleEndian;
-
-import java.io.Closeable;
-
-import org.apache.drill.exec.ops.FragmentContext;
-import org.apache.drill.exec.util.Pointer;
-
-/**
- * Wrapper class to deal with byte buffer allocation. Ensures users only use designated methods. Also allows inser
- */
-public interface BufferAllocator extends Closeable {
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BufferAllocator.class);
-
-  /**
-   * Allocate a new or reused buffer of the provided size. Note that the buffer may technically be larger than the
-   * requested size for rounding purposes. However, the buffers capacity will be set to the configured size.
-   *
-   * @param size
-   *          The size in bytes.
-   * @return A new ByteBuf.
-   * @throws OutOfMemoryRuntimeException if buffer cannot be allocated
-   */
-  public abstract DrillBuf buffer(int size);
-
-  /**
-   * Allocate a new or reused buffer within provided range. Note that the buffer may technically be larger than the
-   * requested size for rounding purposes. However, the buffers capacity will be set to the configured size.
-   *
-   * @param minSize The minimum size in bytes.
-   * @param maxSize The maximum size in bytes.
-   * @return A new ByteBuf.
-   * @throws OutOfMemoryRuntimeException if buffer cannot be allocated
-   */
-  public abstract DrillBuf buffer(int minSize, int maxSize);
-
-  public abstract ByteBufAllocator getUnderlyingAllocator();
-
-  /**
-   * Create a child allocator nested below this one.
-   *
-   * @param context - owning fragment for this allocator
-   * @param initialReservation - specified in bytes
-   * @param maximumReservation - specified in bytes
-   * @param applyFragmentLimit - flag to conditionally enable fragment memory limits
-   * @return - a new buffer allocator owned by the parent it was spawned from
-   * @throws OutOfMemoryException - when off-heap memory has been exhausted
-   */
-  public abstract BufferAllocator getChildAllocator(FragmentContext context, long initialReservation,
-      long maximumReservation, boolean applyFragmentLimit) throws OutOfMemoryException;
-
-  /**
-   * Take over ownership of fragment accounting.  Always takes over ownership.
-   * @param buf
-   * @return false if over allocation.
-   */
-  public boolean takeOwnership(DrillBuf buf) ;
-
-  /**
-   * Take over ownership of fragment accounting.  Always takes over ownership.
-   * @param buf
-   * @return false if over allocation.
-   */
-  public boolean takeOwnership(DrillBuf buf, Pointer<DrillBuf> bufOut);
-
-  public PreAllocator getNewPreAllocator();
-
-  //public void addFragmentContext(FragmentContext c);
-
-  /**
-   * For Top Level Allocators. Reset the fragment limits for all allocators
-   */
-  public void resetFragmentLimits();
-
-  /**
-   * For Child allocators to set the Fragment limit for the corresponding fragment allocator.
-   * @param l the new fragment limit
-   */
-  public void setFragmentLimit(long l);
-
-  public long getFragmentLimit();
-
-
-  /**
-   * Not thread safe.
-   *
-   * WARNING: unclaimed pre-allocations leak memory. If you call preAllocate(), you must
-   * make sure to ultimately try to get the buffer and release it.
-   */
-  public interface PreAllocator {
-    public boolean preAllocate(int bytes);
-
-    public DrillBuf getAllocation();
-  }
-
-  /**
-   * @param bytes
-   * @return
-   */
-
-  /**
-   *
-   */
-
-  /**
-   * Close and release all buffers generated from this buffer pool.
-   */
-  @Override
-  public abstract void close();
-
-  public abstract long getAllocatedMemory();
-
-  public abstract long getPeakMemoryAllocation();
-
-  public DrillBuf getEmpty();
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/memory/OutOfMemoryRuntimeException.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/memory/OutOfMemoryRuntimeException.java b/exec/java-exec/src/main/java/org/apache/drill/exec/memory/OutOfMemoryRuntimeException.java
deleted file mode 100644
index 305eabd..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/memory/OutOfMemoryRuntimeException.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.memory;
-
-import org.apache.drill.common.exceptions.DrillRuntimeException;
-
-public class OutOfMemoryRuntimeException extends DrillRuntimeException{
-
-  public OutOfMemoryRuntimeException() {
-    super();
-
-  }
-
-  public OutOfMemoryRuntimeException(String message, Throwable cause, boolean enableSuppression,
-      boolean writableStackTrace) {
-    super(message, cause, enableSuppression, writableStackTrace);
-
-  }
-
-  public OutOfMemoryRuntimeException(String message, Throwable cause) {
-    super(message, cause);
-
-  }
-
-  public OutOfMemoryRuntimeException(String message) {
-    super(message);
-
-  }
-
-  public OutOfMemoryRuntimeException(Throwable cause) {
-    super(cause);
-
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
deleted file mode 100644
index 26e1257..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.record;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-
-import org.apache.drill.common.expression.PathSegment;
-import org.apache.drill.common.expression.SchemaPath;
-import org.apache.drill.common.types.TypeProtos.DataMode;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-import org.apache.drill.exec.expr.TypeHelper;
-import org.apache.drill.exec.proto.UserBitShared.SerializedField;
-
-
-public class MaterializedField {
-  private final Key key;
-  // use an ordered set as existing code relies on order (e,g. parquet writer)
-  private final LinkedHashSet<MaterializedField> children;
-
-  private MaterializedField(SchemaPath path, MajorType type) {
-    this(path, type, new LinkedHashSet<MaterializedField>());
-  }
-
-  private MaterializedField(SchemaPath path, MajorType type, LinkedHashSet<MaterializedField> children) {
-    this.key = new Key(path, type);
-    this.children = children;
-  }
-
-  public static MaterializedField create(SerializedField serField){
-    MaterializedField field = new MaterializedField(SchemaPath.create(serField.getNamePart()), serField.getMajorType());
-    for (SerializedField sf:serField.getChildList()) {
-      field.addChild(MaterializedField.create(sf));
-    }
-    return field;
-  }
-
-  /**
-   * Create and return a serialized field based on the current state.
-   */
-  public SerializedField getSerializedField() {
-    SerializedField.Builder serializedFieldBuilder = getAsBuilder();
-    for(MaterializedField childMaterializedField : getChildren()) {
-      serializedFieldBuilder.addChild(childMaterializedField.getSerializedField());
-    }
-    return serializedFieldBuilder.build();
-  }
-
-
-  public SerializedField.Builder getAsBuilder(){
-    return SerializedField.newBuilder() //
-        .setMajorType(key.type) //
-        .setNamePart(key.path.getAsNamePart());
-  }
-
-  public Collection<MaterializedField> getChildren() {
-    return children;
-  }
-
-  public void addChild(MaterializedField field){
-    children.add(field);
-  }
-
-  public MaterializedField clone() {
-    return withPathAndType(getPath(), getType());
-  }
-
-  public MaterializedField withType(MajorType type) {
-    return withPathAndType(getPath(), type);
-  }
-
-  public MaterializedField withPath(SchemaPath path) {
-    return withPathAndType(path, getType());
-  }
-
-  public MaterializedField withPathAndType(final SchemaPath path, final MajorType type) {
-    final LinkedHashSet<MaterializedField> newChildren = new LinkedHashSet<>(children.size());
-    final MaterializedField clone = new MaterializedField(path, type, newChildren);
-    for (final MaterializedField child:children) {
-      newChildren.add(child.clone());
-    }
-    return clone;
-  }
-
-  public String getLastName(){
-    PathSegment seg = key.path.getRootSegment();
-    while (seg.getChild() != null) {
-      seg = seg.getChild();
-    }
-    return seg.getNameSegment().getPath();
-  }
-
-
-  // TODO: rewrite without as direct match rather than conversion then match.
-  public boolean matches(SerializedField field){
-    MaterializedField f = create(field);
-    return f.equals(this);
-  }
-
-  public static MaterializedField create(String path, MajorType type){
-    SchemaPath p = SchemaPath.getSimplePath(path);
-    return create(p, type);
-  }
-
-  public static MaterializedField create(SchemaPath path, MajorType type) {
-    return new MaterializedField(path, type);
-  }
-
-  public SchemaPath getPath(){
-    return key.path;
-  }
-
-  /**
-   * Get the schema path.  Deprecated, use getPath() instead.
-   * @return the SchemaPath of this field.
-   */
-  @Deprecated
-  public SchemaPath getAsSchemaPath(){
-    return getPath();
-  }
-
-//  public String getName(){
-//    StringBuilder sb = new StringBuilder();
-//    boolean first = true;
-//    for(NamePart np : def.getNameList()){
-//      if(np.getType() == Type.ARRAY){
-//        sb.append("[]");
-//      }else{
-//        if(first){
-//          first = false;
-//        }else{
-//          sb.append(".");
-//        }
-//        sb.append('`');
-//        sb.append(np.getName());
-//        sb.append('`');
-//
-//      }
-//    }
-//    return sb.toString();
-//  }
-
-  public int getWidth() {
-    return key.type.getWidth();
-  }
-
-  public MajorType getType() {
-    return key.type;
-  }
-
-  public int getScale() {
-      return key.type.getScale();
-  }
-  public int getPrecision() {
-      return key.type.getPrecision();
-  }
-  public boolean isNullable() {
-    return key.type.getMode() == DataMode.OPTIONAL;
-  }
-
-  public DataMode getDataMode() {
-    return key.type.getMode();
-  }
-
-  public MaterializedField getOtherNullableVersion(){
-    MajorType mt = key.type;
-    DataMode newDataMode = null;
-    switch (mt.getMode()){
-    case OPTIONAL:
-      newDataMode = DataMode.REQUIRED;
-      break;
-    case REQUIRED:
-      newDataMode = DataMode.OPTIONAL;
-      break;
-    default:
-      throw new UnsupportedOperationException();
-    }
-    return new MaterializedField(key.path, mt.toBuilder().setMode(newDataMode).build());
-  }
-
-  public Class<?> getValueClass() {
-    return TypeHelper.getValueVectorClass(getType().getMinorType(), getDataMode());
-  }
-
-  public boolean matches(SchemaPath path) {
-    if (!path.isSimplePath()) {
-      return false;
-    }
-
-    return key.path.equals(path);
-  }
-
-
-  @Override
-  public int hashCode() {
-    int result = 1;
-    // DRILL-1872: Compute hashCode only on key. See also the comment
-    // in MapVector$MapTransferPair
-    result = ((key == null) ? 0 : key.hashCode());
-    return result;
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (getClass() != obj.getClass()) {
-      return false;
-    }
-    MaterializedField other = (MaterializedField) obj;
-    // DRILL-1872: Compute equals only on key. See also the comment
-    // in MapVector$MapTransferPair
-
-    if (key == null) {
-      if (other.key != null) {
-        return false;
-      }
-    } else if (!key.equals(other.key)) {
-      return false;
-    }
-    return true;
-  }
-
-
-  @Override
-  public String toString() {
-    final int maxLen = 10;
-    String childStr = children != null && !children.isEmpty() ? toString(children, maxLen) : "";
-    return key.path + "(" + key.type.getMinorType().name() + ":" + key.type.getMode().name() + ")" + childStr;
-  }
-
-
-  private String toString(Collection<?> collection, int maxLen) {
-    StringBuilder builder = new StringBuilder();
-    builder.append("[");
-    int i = 0;
-    for (Iterator<?> iterator = collection.iterator(); iterator.hasNext() && i < maxLen; i++) {
-      if (i > 0){
-        builder.append(", ");
-      }
-      builder.append(iterator.next());
-    }
-    builder.append("]");
-    return builder.toString();
-  }
-
-  public Key key() {
-    return key;
-  }
-
-  public String toExpr(){
-    return key.path.toExpr();
-  }
-
-  /**
-   * Since the {@code MaterializedField) itself is mutable, in certain cases, it is not suitable
-   * as a key of a {@link Map}. This inner class allows the {@link MaterializedField} object to be
-   * used for this purpose.
-   */
-  public class Key {
-
-    private final SchemaPath path;
-    private final MajorType type;
-
-    private Key(SchemaPath path, MajorType type) {
-      this.path = path;
-      this.type = type;
-    }
-
-    @Override
-    public int hashCode() {
-      final int prime = 31;
-      int result = 1;
-      result = prime * result + ((path == null) ? 0 : path.hashCode());
-      return result;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-      if (this == obj) {
-        return true;
-      }
-      if (obj == null) {
-        return false;
-      }
-      if (getClass() != obj.getClass()) {
-        return false;
-      }
-      Key other = (Key) obj;
-      if (path == null) {
-        if (other.path != null) {
-          return false;
-        }
-      } else if (!path.equals(other.path)) {
-        return false;
-      }
-
-      return true;
-    }
-
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java
deleted file mode 100644
index 3585a8c..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.record;
-
-import org.apache.drill.exec.vector.ValueVector;
-
-public interface TransferPair {
-  public void transfer();
-  public void splitAndTransfer(int startIndex, int length);
-  public ValueVector getTo();
-  public void copyValueSafe(int from, int to);
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/record/TypedFieldId.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/record/TypedFieldId.java b/exec/java-exec/src/main/java/org/apache/drill/exec/record/TypedFieldId.java
deleted file mode 100644
index 931f981..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/record/TypedFieldId.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.record;
-
-import java.util.Arrays;
-
-import org.apache.commons.lang3.ArrayUtils;
-import org.apache.drill.common.expression.PathSegment;
-import org.apache.drill.common.types.TypeProtos.MajorType;
-import org.apache.drill.exec.expr.TypeHelper;
-import org.apache.drill.exec.vector.ValueVector;
-
-import com.carrotsearch.hppc.IntArrayList;
-import com.google.common.base.Preconditions;
-
-public class TypedFieldId {
-  final MajorType finalType;
-  final MajorType secondaryFinal;
-  final MajorType intermediateType;
-  final int[] fieldIds;
-  final boolean isHyperReader;
-  final boolean isListVector;
-  final PathSegment remainder;
-
-  public TypedFieldId(MajorType type, int... fieldIds) {
-    this(type, type, type, false, null, fieldIds);
-  }
-
-  public TypedFieldId(MajorType type, IntArrayList breadCrumb, PathSegment remainder) {
-    this(type, type, type, false, remainder, breadCrumb.toArray());
-  }
-
-  public TypedFieldId(MajorType type, boolean isHyper, int... fieldIds) {
-    this(type, type, type, isHyper, null, fieldIds);
-  }
-
-  public TypedFieldId(MajorType intermediateType, MajorType secondaryFinal, MajorType finalType, boolean isHyper, PathSegment remainder, int... fieldIds) {
-    this(intermediateType, secondaryFinal, finalType, isHyper, false, remainder, fieldIds);
-  }
-
-  public TypedFieldId(MajorType intermediateType, MajorType secondaryFinal, MajorType finalType, boolean isHyper, boolean isListVector, PathSegment remainder, int... fieldIds) {
-    super();
-    this.intermediateType = intermediateType;
-    this.finalType = finalType;
-    this.secondaryFinal = secondaryFinal;
-    this.fieldIds = fieldIds;
-    this.isHyperReader = isHyper;
-    this.isListVector = isListVector;
-    this.remainder = remainder;
-  }
-
-  public TypedFieldId cloneWithChild(int id) {
-    int[] fieldIds = ArrayUtils.add(this.fieldIds, id);
-    return new TypedFieldId(intermediateType, secondaryFinal, finalType, isHyperReader, remainder, fieldIds);
-  }
-
-  public PathSegment getLastSegment() {
-    if (remainder == null) {
-      return null;
-    }
-    PathSegment seg = remainder;
-    while (seg.getChild() != null) {
-      seg = seg.getChild();
-    }
-    return seg;
-  }
-
-  public TypedFieldId cloneWithRemainder(PathSegment remainder) {
-    return new TypedFieldId(intermediateType, secondaryFinal, finalType, isHyperReader, remainder, fieldIds);
-  }
-
-  public boolean hasRemainder() {
-    return remainder != null;
-  }
-
-  public PathSegment getRemainder() {
-    return remainder;
-  }
-
-  public boolean isHyperReader() {
-    return isHyperReader;
-  }
-
-  public boolean isListVector() {
-    return isListVector;
-  }
-
-  public MajorType getIntermediateType() {
-    return intermediateType;
-  }
-
-  public Class<? extends ValueVector> getIntermediateClass() {
-    return (Class<? extends ValueVector>) TypeHelper.getValueVectorClass(intermediateType.getMinorType(), intermediateType.getMode());
-  }
-
-  public MajorType getFinalType() {
-    return finalType;
-  }
-
-  public int[] getFieldIds() {
-    return fieldIds;
-  }
-
-  public MajorType getSecondaryFinal() {
-    return secondaryFinal;
-  }
-
-  public static Builder newBuilder() {
-    return new Builder();
-  }
-
-  public static class Builder{
-    final IntArrayList ids = new IntArrayList();
-    MajorType finalType;
-    MajorType intermediateType;
-    MajorType secondaryFinal;
-    PathSegment remainder;
-    boolean hyperReader = false;
-    boolean withIndex = false;
-    boolean isListVector = false;
-
-    public Builder addId(int id) {
-      ids.add(id);
-      return this;
-    }
-
-    public Builder withIndex() {
-      withIndex = true;
-      return this;
-    }
-
-    public Builder remainder(PathSegment remainder) {
-      this.remainder = remainder;
-      return this;
-    }
-
-    public Builder hyper() {
-      this.hyperReader = true;
-      return this;
-    }
-
-    public Builder listVector() {
-      this.isListVector = true;
-      return this;
-    }
-
-    public Builder finalType(MajorType finalType) {
-      this.finalType = finalType;
-      return this;
-    }
-
-    public Builder secondaryFinal(MajorType secondaryFinal) {
-      this.secondaryFinal = secondaryFinal;
-      return this;
-    }
-
-    public Builder intermediateType(MajorType intermediateType) {
-      this.intermediateType = intermediateType;
-      return this;
-    }
-
-    public TypedFieldId build() {
-      Preconditions.checkNotNull(intermediateType);
-      Preconditions.checkNotNull(finalType);
-
-      if (intermediateType == null) {
-        intermediateType = finalType;
-      }
-      if (secondaryFinal == null) {
-        secondaryFinal = finalType;
-      }
-
-      MajorType actualFinalType = finalType;
-      //MajorType secondaryFinal = finalType;
-
-      // if this has an index, switch to required type for output
-      //if(withIndex && intermediateType == finalType) actualFinalType = finalType.toBuilder().setMode(DataMode.REQUIRED).build();
-
-      // if this isn't a direct access, switch the final type to nullable as offsets may be null.
-      // TODO: there is a bug here with some things.
-      //if(intermediateType != finalType) actualFinalType = finalType.toBuilder().setMode(DataMode.OPTIONAL).build();
-
-      return new TypedFieldId(intermediateType, secondaryFinal, actualFinalType, hyperReader, isListVector, remainder, ids.toArray());
-    }
-  }
-
-  @Override
-  public int hashCode() {
-    final int prime = 31;
-    int result = 1;
-    result = prime * result + Arrays.hashCode(fieldIds);
-    result = prime * result + ((finalType == null) ? 0 : finalType.hashCode());
-    result = prime * result + ((intermediateType == null) ? 0 : intermediateType.hashCode());
-    result = prime * result + (isHyperReader ? 1231 : 1237);
-    result = prime * result + ((remainder == null) ? 0 : remainder.hashCode());
-    result = prime * result + ((secondaryFinal == null) ? 0 : secondaryFinal.hashCode());
-    return result;
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (getClass() != obj.getClass()) {
-      return false;
-    }
-    TypedFieldId other = (TypedFieldId) obj;
-    if (!Arrays.equals(fieldIds, other.fieldIds)) {
-      return false;
-    }
-    if (finalType == null) {
-      if (other.finalType != null) {
-        return false;
-      }
-    } else if (!finalType.equals(other.finalType)) {
-      return false;
-    }
-    if (intermediateType == null) {
-      if (other.intermediateType != null) {
-        return false;
-      }
-    } else if (!intermediateType.equals(other.intermediateType)) {
-      return false;
-    }
-    if (isHyperReader != other.isHyperReader) {
-      return false;
-    }
-    if (remainder == null) {
-      if (other.remainder != null) {
-        return false;
-      }
-    } else if (!remainder.equals(other.remainder)) {
-      return false;
-    }
-    if (secondaryFinal == null) {
-      if (other.secondaryFinal != null) {
-        return false;
-      }
-    } else if (!secondaryFinal.equals(other.secondaryFinal)) {
-      return false;
-    }
-    return true;
-  }
-
-  @Override
-  public String toString() {
-    final int maxLen = 10;
-    return "TypedFieldId [fieldIds="
-        + (fieldIds != null ? Arrays.toString(Arrays.copyOf(fieldIds, Math.min(fieldIds.length, maxLen))) : null)
-        + ", remainder=" + remainder + "]";
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/util/CallBack.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/CallBack.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/CallBack.java
deleted file mode 100644
index 0243f8a..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/CallBack.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.util;
-
-
-public interface CallBack {
-  public void doWork();
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java
deleted file mode 100644
index dd5145d..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringArrayList.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.hadoop.io.Text;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-public class JsonStringArrayList<E> extends ArrayList<E> {
-
-  private static ObjectMapper mapper;
-
-  static {
-    mapper = new ObjectMapper();
-    SimpleModule serializer = new SimpleModule("TextSerializer")
-        .addSerializer(Text.class, new TextSerializer());
-    mapper.registerModule(serializer);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (!(obj instanceof List)) {
-      return false;
-    }
-    List other = (List) obj;
-    return this.size() == other.size() && this.containsAll(other);
-  }
-
-  @Override
-  public final String toString() {
-    try {
-      return mapper.writeValueAsString(this);
-    } catch(JsonProcessingException e) {
-      throw new IllegalStateException("Cannot serialize array list to JSON string", e);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java
deleted file mode 100644
index ac980eb..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/JsonStringHashMap.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.util;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.apache.hadoop.io.Text;
-
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-
-/*
- * Simple class that extends the regular java.util.HashMap but overrides the
- * toString() method of the HashMap class to produce a JSON string instead
- */
-public class JsonStringHashMap<K, V> extends LinkedHashMap<K, V> {
-
-  private static ObjectMapper mapper;
-
-  static {
-    mapper = new ObjectMapper();
-    SimpleModule serializer = new SimpleModule("TextSerializer")
-        .addSerializer(Text.class, new TextSerializer());
-    mapper.registerModule(serializer);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (!(obj instanceof Map)) {
-      return false;
-    }
-    Map other = (Map) obj;
-    if (this.size() != other.size()) {
-      return false;
-    }
-    for (K key : this.keySet()) {
-      if (this.get(key) == null ) {
-        if (other.get(key) == null) {
-          continue;
-        } else {
-          return false;
-        }
-      }
-      if ( ! this.get(key).equals(other.get(key))) {
-        return false;
-      }
-    }
-    return true;
-  }
-
-  @Override
-  public final String toString() {
-    try {
-      return mapper.writeValueAsString(this);
-    } catch(JsonProcessingException e) {
-      throw new IllegalStateException("Cannot serialize hash map to JSON string", e);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/util/Pointer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/Pointer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/Pointer.java
deleted file mode 100644
index 074ed76..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/Pointer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.util;
-
-public class Pointer<T> {
-  public T value;
-
-  public Pointer(){}
-
-  public Pointer(T value){
-    this.value = value;
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/util/TextSerializer.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/util/TextSerializer.java b/exec/java-exec/src/main/java/org/apache/drill/exec/util/TextSerializer.java
deleted file mode 100644
index 87df102..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/util/TextSerializer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.util;
-
-import java.io.IOException;
-
-import org.apache.hadoop.io.Text;
-
-import com.fasterxml.jackson.core.JsonGenerationException;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-
-public class TextSerializer extends StdSerializer<Text> {
-
-  public TextSerializer() {
-    super(Text.class);
-  }
-
-  @Override
-  public void serialize(Text text, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonGenerationException {
-    jsonGenerator.writeString(text.toString());
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AddOrGetResult.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AddOrGetResult.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AddOrGetResult.java
deleted file mode 100644
index 7d1f08d..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AddOrGetResult.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.vector;
-
-import com.google.common.base.Preconditions;
-
-public class AddOrGetResult<V extends ValueVector> {
-  private final V vector;
-  private final boolean created;
-
-  public AddOrGetResult(V vector, boolean created) {
-    this.vector = Preconditions.checkNotNull(vector);
-    this.created = created;
-  }
-
-  public V getVector() {
-    return vector;
-  }
-
-  public boolean isCreated() {
-    return created;
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AllocationHelper.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AllocationHelper.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AllocationHelper.java
deleted file mode 100644
index 622e2d2..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/AllocationHelper.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.vector;
-
-import org.apache.drill.exec.vector.complex.RepeatedFixedWidthVectorLike;
-import org.apache.drill.exec.vector.complex.RepeatedVariableWidthVectorLike;
-
-public class AllocationHelper {
-//  private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(AllocationHelper.class);
-
-  public static void allocate(ValueVector v, int valueCount, int bytesPerValue) {
-    allocate(v, valueCount, bytesPerValue, 5);
-  }
-
-  public static void allocatePrecomputedChildCount(ValueVector v, int valueCount, int bytesPerValue, int childValCount){
-    if(v instanceof FixedWidthVector) {
-      ((FixedWidthVector) v).allocateNew(valueCount);
-    } else if (v instanceof VariableWidthVector) {
-      ((VariableWidthVector) v).allocateNew(valueCount * bytesPerValue, valueCount);
-    } else if(v instanceof RepeatedFixedWidthVectorLike) {
-      ((RepeatedFixedWidthVectorLike) v).allocateNew(valueCount, childValCount);
-    } else if(v instanceof RepeatedVariableWidthVectorLike) {
-      ((RepeatedVariableWidthVectorLike) v).allocateNew(childValCount * bytesPerValue, valueCount, childValCount);
-    } else {
-      v.allocateNew();
-    }
-  }
-
-  public static void allocate(ValueVector v, int valueCount, int bytesPerValue, int repeatedPerTop){
-    allocatePrecomputedChildCount(v, valueCount, bytesPerValue, repeatedPerTop * valueCount);
-  }
-
-  /**
-   * Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocation
-   * @param v value vector we are trying to allocate
-   * @param valueCount  size we are trying to allocate
-   * @throws org.apache.drill.exec.memory.OutOfMemoryRuntimeException if it can't allocate the memory
-   */
-  public static void allocateNew(ValueVector v, int valueCount) {
-    if (v instanceof  FixedWidthVector) {
-      ((FixedWidthVector) v).allocateNew(valueCount);
-    } else {
-      v.allocateNew();
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/9969d8bd/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
deleted file mode 100644
index 2fc741c..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseDataValueVector.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.drill.exec.vector;
-
-import io.netty.buffer.DrillBuf;
-import org.apache.drill.exec.memory.BufferAllocator;
-import org.apache.drill.exec.record.MaterializedField;
-
-
-public abstract class BaseDataValueVector extends BaseValueVector {
-
-  protected final static byte[] emptyByteArray = new byte[]{}; // Nullable vectors use this
-
-  protected DrillBuf data;
-
-  public BaseDataValueVector(MaterializedField field, BufferAllocator allocator) {
-    super(field, allocator);
-    data = allocator.getEmpty();
-  }
-
-  @Override
-  public void clear() {
-    if (data != null) {
-      data.release();
-    }
-    data = allocator.getEmpty();
-    super.clear();
-  }
-
-  @Override
-  public void close() {
-    clear();
-    if (data != null) {
-      data.release();
-      data = null;
-    }
-    super.close();
-  }
-
-  @Override
-  public DrillBuf[] getBuffers(boolean clear) {
-    DrillBuf[] out;
-    if (getBufferSize() == 0) {
-      out = new DrillBuf[0];
-    } else {
-      out = new DrillBuf[]{data};
-      if (clear) {
-        data.readerIndex(0);
-        data.retain(1);
-      }
-    }
-    if (clear) {
-      clear();
-    }
-    return out;
-  }
-
-  @Override
-  public int getBufferSize() {
-    if (getAccessor().getValueCount() == 0) {
-      return 0;
-    }
-    return data.writerIndex();
-  }
-
-  public DrillBuf getBuffer() {
-    return data;
-  }
-
-  /**
-   * This method has a similar effect of allocateNew() without actually clearing and reallocating
-   * the value vector. The purpose is to move the value vector to a "mutate" state
-   */
-  public void reset() {}
-}


Mime
View raw message