drill-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jacq...@apache.org
Subject [08/12] drill git commit: DRILL-4241: Add wait stats and estimated row count in RecordReader
Date Mon, 11 Jan 2016 07:53:56 GMT
DRILL-4241: Add wait stats and estimated row count in RecordReader


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

Branch: refs/heads/master
Commit: 54cf72724ab365831f4023b9ef14cd683f7f3561
Parents: 4ba5155
Author: Steven Phillips <smp@apache.org>
Authored: Thu Nov 19 16:54:41 2015 -0800
Committer: Jacques Nadeau <jacques@apache.org>
Committed: Sun Jan 10 22:54:21 2016 -0800

----------------------------------------------------------------------
 .../drill/exec/store/kudu/KuduGroupScan.java    |  4 +++-
 .../drill/exec/store/kudu/KuduRecordReader.java | 23 +++++++++++++++-----
 2 files changed, 21 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/drill/blob/54cf7272/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduGroupScan.java
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduGroupScan.java
b/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduGroupScan.java
index 8403632..ff4295d 100644
--- a/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduGroupScan.java
+++ b/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduGroupScan.java
@@ -33,6 +33,7 @@ import org.apache.drill.exec.physical.base.AbstractGroupScan;
 import org.apache.drill.exec.physical.base.GroupScan;
 import org.apache.drill.exec.physical.base.PhysicalOperator;
 import org.apache.drill.exec.physical.base.ScanStats;
+import org.apache.drill.exec.physical.base.ScanStats.GroupScanProperty;
 import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
 import org.apache.drill.exec.store.StoragePluginRegistry;
 import org.apache.drill.exec.store.kudu.KuduSubScan.KuduSubScanSpec;
@@ -210,7 +211,8 @@ public class KuduGroupScan extends AbstractGroupScan {
   // List<KuduSubScanSpec> tabletInfoList, List<SchemaPath> columns
   @Override
   public ScanStats getScanStats() {
-    return ScanStats.TRIVIAL_TABLE;
+    long recordCount = 100000 * kuduWorkList.size();
+    return new ScanStats(GroupScanProperty.NO_EXACT_ROW_COUNT, recordCount, 1, recordCount);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/drill/blob/54cf7272/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduRecordReader.java
----------------------------------------------------------------------
diff --git a/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduRecordReader.java
b/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduRecordReader.java
index 6b7877d..7f7fc35 100644
--- a/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduRecordReader.java
+++ b/contrib/storage-kudu/src/main/java/org/apache/drill/exec/store/kudu/KuduRecordReader.java
@@ -77,6 +77,7 @@ public class KuduRecordReader extends AbstractRecordReader {
   private RowResultIterator iterator;
   
   private OutputMutator output;
+  private OperatorContext context;
 
   private static class ProjectedColumnInfo {
     int index;
@@ -97,6 +98,7 @@ public class KuduRecordReader extends AbstractRecordReader {
   @Override
   public void setup(OperatorContext context, OutputMutator output) throws ExecutionSetupException
{
     this.output = output;
+    this.context = context;
     try {
       KuduTable table = client.openTable(scanSpec.getTableName());
       
@@ -108,10 +110,16 @@ public class KuduRecordReader extends AbstractRecordReader {
         }
         builder.setProjectedColumnNames(colNames);
       }
-      scanner = builder
-              .lowerBoundPartitionKeyRaw(scanSpec.getStartKey())
-              .exclusiveUpperBoundPartitionKeyRaw(scanSpec.getEndKey())
-              .build();
+
+      context.getStats().startWait();
+      try {
+        scanner = builder
+                .lowerBoundPartitionKeyRaw(scanSpec.getStartKey())
+                .exclusiveUpperBoundPartitionKeyRaw(scanSpec.getEndKey())
+                .build();
+      } finally {
+        context.getStats().stopWait();
+      }
     } catch (Exception e) {
       throw new ExecutionSetupException(e);
     }
@@ -143,7 +151,12 @@ public class KuduRecordReader extends AbstractRecordReader {
           iterator = null;
           return 0;
         }
-        iterator = scanner.nextRows();
+        context.getStats().startWait();
+        try {
+          iterator = scanner.nextRows();
+        } finally {
+          context.getStats().stopWait();
+        }
       }
       for (; rowCount < TARGET_RECORD_COUNT && iterator.hasNext(); rowCount++)
{
         addRowResult(iterator.next(), rowCount);


Mime
View raw message