drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h.@apache.org
Subject drill git commit: DRILL-3108: Replace templated returns with covariant return overrides
Date Fri, 29 May 2015 02:42:15 GMT
Repository: drill
Updated Branches:
  refs/heads/master 21f86effe -> b7c99dde0


DRILL-3108: Replace templated returns with covariant return overrides


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

Branch: refs/heads/master
Commit: b7c99dde0286416ac036b90a597f18039e34e975
Parents: 21f86ef
Author: Hanifi Gunes <hgunes@maprtech.com>
Authored: Fri May 15 14:54:18 2015 -0700
Committer: Hanifi Gunes <hgunes@maprtech.com>
Committed: Thu May 28 17:08:53 2015 -0700

----------------------------------------------------------------------
 .../drill/exec/vector/BaseDataValueVector.java  |  3 +--
 .../exec/vector/BaseRepeatedValueVector.java    |  4 +---
 .../drill/exec/vector/BaseValueVector.java      |  3 +--
 .../drill/exec/vector/RepeatedValueVector.java  |  9 +++-----
 .../drill/exec/vector/SerializableVector.java   | 24 --------------------
 .../apache/drill/exec/vector/ValueVector.java   | 17 +++++---------
 .../exec/vector/complex/RepeatedListVector.java |  3 +--
 7 files changed, 13 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/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
index 6d356f2..0e38f3c 100644
--- 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
@@ -22,8 +22,7 @@ import org.apache.drill.exec.memory.BufferAllocator;
 import org.apache.drill.exec.record.MaterializedField;
 
 
-public abstract class BaseDataValueVector<A extends BaseValueVector.BaseAccessor, M extends
BaseValueVector.BaseMutator>
-    extends BaseValueVector<A, M> {
+public abstract class BaseDataValueVector extends BaseValueVector{
 
   protected DrillBuf data;
 

http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseRepeatedValueVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseRepeatedValueVector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseRepeatedValueVector.java
index bcf0793..be04680 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseRepeatedValueVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseRepeatedValueVector.java
@@ -23,7 +23,6 @@ import java.util.Iterator;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ObjectArrays;
 import io.netty.buffer.DrillBuf;
-import org.apache.drill.common.exceptions.DrillRuntimeException;
 import org.apache.drill.common.types.TypeProtos;
 import org.apache.drill.common.types.Types;
 import org.apache.drill.exec.exception.SchemaChangeRuntimeException;
@@ -32,8 +31,7 @@ import org.apache.drill.exec.memory.BufferAllocator;
 import org.apache.drill.exec.proto.UserBitShared;
 import org.apache.drill.exec.record.MaterializedField;
 
-public abstract class BaseRepeatedValueVector<A extends RepeatedValueVector.RepeatedAccessor,
M extends RepeatedValueVector.RepeatedMutator>
-  extends BaseValueVector<A, M> implements RepeatedValueVector<A, M> {
+public abstract class BaseRepeatedValueVector extends BaseValueVector implements RepeatedValueVector
{
 
   public final static ValueVector DEFAULT_DATA_VECTOR = ZeroVector.INSTANCE;
   public final static String OFFSETS_VECTOR_NAME = "offsets";

http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseValueVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseValueVector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseValueVector.java
index 67c489d..c8b6d4d 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseValueVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/BaseValueVector.java
@@ -27,8 +27,7 @@ import org.apache.drill.exec.proto.UserBitShared.SerializedField;
 import org.apache.drill.exec.record.MaterializedField;
 import org.apache.drill.exec.record.TransferPair;
 
-public abstract class BaseValueVector<A extends ValueVector.Accessor, M extends ValueVector.Mutator>
-    implements ValueVector<A, M> {
+public abstract class BaseValueVector implements ValueVector {
   private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseValueVector.class);
 
   protected final BufferAllocator allocator;

http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/exec/java-exec/src/main/java/org/apache/drill/exec/vector/RepeatedValueVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/RepeatedValueVector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/RepeatedValueVector.java
index d5a8281..95a7252 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/RepeatedValueVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/RepeatedValueVector.java
@@ -24,11 +24,8 @@ package org.apache.drill.exec.vector;
  * Current design maintains data and offsets vectors. Each cell is stored in the data vector.
Repeated vector
  * uses the offset vector to determine the sequence of cells pertaining to an individual
value.
  *
- * @param <A>  repeated accessor type
- * @param <M>  repeated mutator type
  */
-public interface RepeatedValueVector<A extends RepeatedValueVector.RepeatedAccessor, M
extends RepeatedValueVector.RepeatedMutator>
-    extends ValueVector<A, M>, ContainerVectorLike {
+public interface RepeatedValueVector extends ValueVector, ContainerVectorLike {
 
   final static int DEFAULT_REPEAT_PER_RECORD = 5;
 
@@ -45,10 +42,10 @@ public interface RepeatedValueVector<A extends RepeatedValueVector.RepeatedAcces
   ValueVector getDataVector();
 
   @Override
-  A getAccessor();
+  RepeatedAccessor getAccessor();
 
   @Override
-  M getMutator();
+  RepeatedMutator getMutator();
 
   interface RepeatedAccessor extends ValueVector.Accessor {
     /**

http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/exec/java-exec/src/main/java/org/apache/drill/exec/vector/SerializableVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/SerializableVector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/SerializableVector.java
deleted file mode 100644
index 62c8a18..0000000
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/SerializableVector.java
+++ /dev/null
@@ -1,24 +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;
-
-
-public interface SerializableVector extends ValueVector{
-
-
-}

http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ValueVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ValueVector.java b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ValueVector.java
index ab9992e..3948163 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ValueVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/ValueVector.java
@@ -37,11 +37,8 @@ import org.apache.drill.exec.vector.complex.reader.FieldReader;
  * A vector when instantiated, relies on a {@link org.apache.drill.exec.record.DeadBuf dead
buffer}. It is important
  * that vector is allocated before attempting to read or write.
  *
- * @param <A>  accessor type that supports reading from this vector
- * @param <M>  mutator type that supports writing to this vector
  */
-public interface ValueVector<A extends ValueVector.Accessor, M extends ValueVector.Mutator>
-    extends Closeable, Iterable<ValueVector> {
+public interface ValueVector extends Closeable, Iterable<ValueVector> {
 
   /**
    * Allocate new buffers. ValueVector implements logic to determine how much to allocate.
@@ -59,7 +56,7 @@ public interface ValueVector<A extends ValueVector.Accessor, M extends
ValueVect
    * Set the initial record capacity
    * @param numRecords
    */
-  public void setInitialCapacity(int numRecords);
+  void setInitialCapacity(int numRecords);
 
   /**
    * Returns the maximum number of values that can be stored in this vector instance.
@@ -99,13 +96,13 @@ public interface ValueVector<A extends ValueVector.Accessor, M extends
ValueVect
    * Returns an {@link org.apache.drill.exec.vector.ValueVector.Accessor accessor} that is
used to read from this vector
    * instance.
    */
-  A getAccessor();
+  Accessor getAccessor();
 
   /**
    * Returns an {@link org.apache.drill.exec.vector.ValueVector.Mutator mutator} that is
used to write to this vector
    * instance.
    */
-  M getMutator();
+  Mutator getMutator();
 
   /**
    * Returns a {@link org.apache.drill.exec.vector.complex.reader.FieldReader field reader}
that supports reading values
@@ -149,17 +146,15 @@ public interface ValueVector<A extends ValueVector.Accessor, M extends
ValueVect
 
   /**
    * An abstraction that is used to read from this vector instance.
-   *
-   * @param <BT>  boxed value type that is stored in this vector.
    */
-  interface Accessor<BT> {
+  interface Accessor {
     /**
      * Get the Java Object representation of the element at the specified position. Useful
for testing.
      *
      * @param index
      *          Index of the value to get
      */
-    BT getObject(int index);
+    Object getObject(int index);
 
     /**
      * Returns the number of values that is stored in this vector.

http://git-wip-us.apache.org/repos/asf/drill/blob/b7c99dde/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
----------------------------------------------------------------------
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
index b5de8b1..443a761 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/vector/complex/RepeatedListVector.java
@@ -58,8 +58,7 @@ public class RepeatedListVector extends AbstractContainerVector
   private final RepeatedListReaderImpl reader = new RepeatedListReaderImpl(null, this);
   private final DelegateRepeatedVector delegate;
 
-  protected static class DelegateRepeatedVector
-      extends BaseRepeatedValueVector<DelegateRepeatedVector.RepeatedListAccessor, DelegateRepeatedVector.RepeatedListMutator>
{
+  protected static class DelegateRepeatedVector extends BaseRepeatedValueVector {
 
     private final RepeatedListAccessor accessor = new RepeatedListAccessor();
     private final RepeatedListMutator mutator = new RepeatedListMutator();


Mime
View raw message