kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [3/3] incubator-kudu git commit: KUDU-1269: KuduScanner should expose its projection schema
Date Fri, 22 Jan 2016 02:32:48 GMT
KUDU-1269: KuduScanner should expose its projection schema

While I was at it, I also copied the other public getters from
AsyncKuduScanner into KuduScanner.

Change-Id: I1568744669c2d632aa737658f79bb9ba336439ad
Reviewed-on: http://gerrit.cloudera.org:8080/1869
Reviewed-by: Jean-Daniel Cryans
Reviewed-by: Todd Lipcon <todd@apache.org>
Tested-by: Internal Jenkins


Project: http://git-wip-us.apache.org/repos/asf/incubator-kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kudu/commit/8260093b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kudu/tree/8260093b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kudu/diff/8260093b

Branch: refs/heads/master
Commit: 8260093b9e53445801c8b69d9b69700721c965ce
Parents: efa7e82
Author: Adar Dembo <adar@cloudera.com>
Authored: Thu Jan 21 17:03:12 2016 -0800
Committer: Todd Lipcon <todd@apache.org>
Committed: Fri Jan 22 02:32:29 2016 +0000

----------------------------------------------------------------------
 .../org/kududb/client/AsyncKuduScanner.java     | 13 +++++-
 .../java/org/kududb/client/KuduScanner.java     | 45 ++++++++++++++++++++
 2 files changed, 56 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/8260093b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduScanner.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduScanner.java b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduScanner.java
index 0b4a5c2..ecb916a 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduScanner.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/AsyncKuduScanner.java
@@ -321,7 +321,7 @@ public final class AsyncKuduScanner {
    * @return a long representing the maximum number of rows that can be returned
    */
   public long getLimit() {
-    return limit;
+    return this.limit;
   }
 
   /**
@@ -346,7 +346,7 @@ public final class AsyncKuduScanner {
    * from a tablet server
    */
   public long getBatchSizeBytes() {
-    return batchSizeBytes;
+    return this.batchSizeBytes;
   }
 
   /**
@@ -357,6 +357,15 @@ public final class AsyncKuduScanner {
     return this.readMode;
   }
 
+  /**
+   * Returns the projection schema of this scanner. If specific columns were
+   * not specified during scanner creation, the table schema is returned.
+   * @return the projection schema for this scanner
+   */
+  public Schema getProjectionSchema() {
+    return this.schema;
+  }
+
   long getSnapshotTimestamp() {
     return this.htTimestamp;
   }

http://git-wip-us.apache.org/repos/asf/incubator-kudu/blob/8260093b/java/kudu-client/src/main/java/org/kududb/client/KuduScanner.java
----------------------------------------------------------------------
diff --git a/java/kudu-client/src/main/java/org/kududb/client/KuduScanner.java b/java/kudu-client/src/main/java/org/kududb/client/KuduScanner.java
index 962bdfd..cdaaa46 100644
--- a/java/kudu-client/src/main/java/org/kududb/client/KuduScanner.java
+++ b/java/kudu-client/src/main/java/org/kududb/client/KuduScanner.java
@@ -17,8 +17,11 @@
 package org.kududb.client;
 
 import com.stumbleupon.async.Deferred;
+
+import org.kududb.Schema;
 import org.kududb.annotations.InterfaceAudience;
 import org.kududb.annotations.InterfaceStability;
+import org.kududb.client.AsyncKuduScanner.ReadMode;
 
 /**
  * Synchronous version of {@link AsyncKuduScanner}. Offers the same API but with blocking
methods.
@@ -66,6 +69,48 @@ public class KuduScanner {
   }
 
   /**
+   * Returns the maximum number of rows that this scanner was configured to return.
+   * @return a long representing the maximum number of rows that can be returned
+   */
+  public long getLimit() {
+    return asyncScanner.getLimit();
+  }
+
+  /**
+   * Returns if this scanner was configured to cache data blocks or not.
+   * @return true if this scanner will cache blocks, else else.
+   */
+  public boolean getCacheBlocks() {
+    return asyncScanner.getCacheBlocks();
+  }
+
+  /**
+   * Returns the maximum number of bytes returned by the scanner, on each batch.
+   * @return a long representing the maximum number of bytes that a scanner can receive at
once
+   * from a tablet server
+   */
+  public long getBatchSizeBytes() {
+    return asyncScanner.getBatchSizeBytes();
+  }
+
+  /**
+   * Returns the ReadMode for this scanner.
+   * @return the configured read mode for this scanner
+   */
+  public ReadMode getReadMode() {
+    return asyncScanner.getReadMode();
+  }
+
+  /**
+   * Returns the projection schema of this scanner. If specific columns were
+   * not specified during scanner creation, the table schema is returned.
+   * @return the projection schema for this scanner
+   */
+  public Schema getProjectionSchema() {
+    return asyncScanner.getProjectionSchema();
+  }
+
+  /**
    * A Builder class to build {@link KuduScanner}.
    * Use {@link KuduClient#newScannerBuilder} in order to get a builder instance.
    */


Mime
View raw message