drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [20/50] [abbrv] drill git commit: Use DBDocumentReaderBase instead of DBDocumentReader.
Date Tue, 13 Sep 2016 01:32:07 GMT
Use DBDocumentReaderBase instead of DBDocumentReader.


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

Branch: refs/heads/master
Commit: aa6312171f8a325d5fccdd7d91ba91d0eb2b366c
Parents: f97a333
Author: Aditya Kishore <adi@apache.org>
Authored: Fri Aug 26 13:12:41 2016 -0700
Committer: Aditya Kishore <adi@apache.org>
Committed: Fri Sep 9 10:08:32 2016 -0700

----------------------------------------------------------------------
 .../drill/exec/store/maprdb/MapRDBSubScanSpec.java  |  3 ++-
 .../store/maprdb/json/MaprDBJsonRecordReader.java   | 16 ++++++++--------
 .../mapr/drill/maprdb/tests/MaprDBTestsSuite.java   |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/aa631217/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/MapRDBSubScanSpec.java
----------------------------------------------------------------------
diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/MapRDBSubScanSpec.java
b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/MapRDBSubScanSpec.java
index 5e8d84c..cc8bc5d 100644
--- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/MapRDBSubScanSpec.java
+++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/MapRDBSubScanSpec.java
@@ -17,6 +17,7 @@
  */
 package org.apache.drill.exec.store.maprdb;
 
+import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.mapr.fs.jni.MapRConstants;
 import com.mapr.org.apache.hadoop.hbase.util.Bytes;
@@ -29,7 +30,7 @@ public class MapRDBSubScanSpec {
   protected byte[] stopRow;
   protected byte[] serializedFilter;
 
-  @parquet.org.codehaus.jackson.annotate.JsonCreator
+  @JsonCreator
   public MapRDBSubScanSpec(@JsonProperty("tableName") String tableName,
                            @JsonProperty("regionServer") String regionServer,
                            @JsonProperty("startRow") byte[] startRow,

http://git-wip-us.apache.org/repos/asf/drill/blob/aa631217/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
----------------------------------------------------------------------
diff --git a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
index 2f2e561..590c6e3 100644
--- a/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
+++ b/contrib/format-maprdb/src/main/java/org/apache/drill/exec/store/maprdb/json/MaprDBJsonRecordReader.java
@@ -63,7 +63,7 @@ import com.mapr.db.Table;
 import com.mapr.db.Table.TableOption;
 import com.mapr.db.exceptions.DBException;
 import com.mapr.db.impl.IdCodec;
-import com.mapr.db.ojai.DBDocumentReader;
+import com.mapr.db.ojai.DBDocumentReaderBase;
 import com.mapr.db.util.ByteBufs;
 import com.mapr.org.apache.hadoop.hbase.util.Bytes;
 
@@ -168,7 +168,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
     int recordCount = 0;
 
     while(recordCount < BaseValueVector.INITIAL_VALUE_ALLOCATION) {
-      DBDocumentReader reader = nextDocumentReader();
+      DBDocumentReaderBase reader = nextDocumentReader();
       if (reader == null) break;
       writer.setPosition(recordCount);
       if (reader.next() != EventType.START_MAP) {
@@ -202,7 +202,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
     return recordCount;
   }
 
-  private void writeToMap(DBDocumentReader reader, MapWriter map) {
+  private void writeToMap(DBDocumentReaderBase reader, MapWriter map) {
     String fieldName = null;
     map.start();
     outside: while (true) {
@@ -271,8 +271,8 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
     map.end();
   }
 
-  private void writeToList(DBDocumentReader reader, ListWriter list) {
-    list.start();
+  private void writeToList(DBDocumentReaderBase reader, ListWriter list) {
+    list.startList();
     outside: while (true) {
       EventType event = reader.next();
       if (event == null) break outside;
@@ -335,7 +335,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
         throw new UnsupportedOperationException("Unsupported type: " + event);
       }
     }
-    list.end();
+    list.endList();
   }
 
   private void writeBinary(VarBinaryWriter binaryWriter, ByteBuffer buf) {
@@ -351,7 +351,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
     varCharWriter.writeVarChar(0, strBytes.length, buffer);
   }
 
-  private DBDocumentReader nextDocumentReader() {
+  private DBDocumentReaderBase nextDocumentReader() {
     final OperatorStats operatorStats = operatorContext == null ? null : operatorContext.getStats();
     try {
       if (operatorStats != null) {
@@ -361,7 +361,7 @@ public class MaprDBJsonRecordReader extends AbstractRecordReader {
         if (!documentReaderIterators.hasNext()) {
           return null;
         } else {
-          return (DBDocumentReader) documentReaderIterators.next();
+          return (DBDocumentReaderBase) documentReaderIterators.next();
         }
       } finally {
         if (operatorStats != null) {

http://git-wip-us.apache.org/repos/asf/drill/blob/aa631217/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/MaprDBTestsSuite.java
----------------------------------------------------------------------
diff --git a/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/MaprDBTestsSuite.java
b/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/MaprDBTestsSuite.java
index cd1333a..0f54796 100644
--- a/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/MaprDBTestsSuite.java
+++ b/contrib/format-maprdb/src/test/java/com/mapr/drill/maprdb/tests/MaprDBTestsSuite.java
@@ -117,7 +117,7 @@ public class MaprDBTestsSuite {
               "  }" +
               "}";
 
-          FileSystemConfig pluginConfig = ctx.getConfig().getMapper().readValue(pluginConfStr,
FileSystemConfig.class);
+          FileSystemConfig pluginConfig = ctx.getLpPersistence().getMapper().readValue(pluginConfStr,
FileSystemConfig.class);
           // create the plugin with "hbase" name so that we can run HBase unit tests against
them
           ctx.getStorage().createOrUpdate("hbase", pluginConfig, true);
         }


Mime
View raw message