kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] 02/02: [java] small fixes for diff scan setup logic
Date Fri, 07 Jun 2019 16:53:25 GMT
This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 086089ab91c70753eb632289fad2a4e30d51dddb
Author: Adar Dembo <adar@cloudera.com>
AuthorDate: Thu Jun 6 22:32:10 2019 -0700

    [java] small fixes for diff scan setup logic
    
    Change-Id: Ie6775221115b078d4b2eb640a15d34ee4f315e27
    Reviewed-on: http://gerrit.cloudera.org:8080/13553
    Reviewed-by: Mike Percy <mpercy@apache.org>
    Reviewed-by: Grant Henke <granthenke@apache.org>
    Tested-by: Adar Dembo <adar@cloudera.com>
---
 .../main/java/org/apache/kudu/client/AsyncKuduScanner.java   | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
index a145cf9..f327faf 100644
--- a/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
+++ b/java/kudu-client/src/main/java/org/apache/kudu/client/AsyncKuduScanner.java
@@ -274,6 +274,12 @@ public final class AsyncKuduScanner {
       checkArgument(readMode == ReadMode.READ_AT_SNAPSHOT, "When specifying a " +
           "HybridClock timestamp, the read mode needs to be set to READ_AT_SNAPSHOT");
     }
+    if (startTimestamp != AsyncKuduClient.NO_TIMESTAMP) {
+      checkArgument(htTimestamp >= 0, "Must have both start and end timestamps " +
+                    "for a diff scan");
+      checkArgument(startTimestamp <= htTimestamp, "Start timestamp must be less " +
+                    "than or equal to end timestamp");
+    }
 
     this.isFaultTolerant = isFaultTolerant;
     if (this.isFaultTolerant) {
@@ -442,7 +448,7 @@ public final class AsyncKuduScanner {
     return keepAlivePeriodMs;
   }
 
-  long getStartSnaphshotTimestamp() {
+  long getStartSnapshotTimestamp() {
     return this.startTimestamp;
   }
 
@@ -1037,8 +1043,8 @@ public final class AsyncKuduScanner {
             if (AsyncKuduScanner.this.getSnapshotTimestamp() != AsyncKuduClient.NO_TIMESTAMP)
{
               newBuilder.setSnapTimestamp(AsyncKuduScanner.this.getSnapshotTimestamp());
             }
-            if (AsyncKuduScanner.this.getStartSnaphshotTimestamp() != AsyncKuduClient.NO_TIMESTAMP)
{
-              newBuilder.setSnapStartTimestamp(AsyncKuduScanner.this.getStartSnaphshotTimestamp());
+            if (AsyncKuduScanner.this.getStartSnapshotTimestamp() != AsyncKuduClient.NO_TIMESTAMP)
{
+              newBuilder.setSnapStartTimestamp(AsyncKuduScanner.this.getStartSnapshotTimestamp());
             }
           }
 


Mime
View raw message