cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/6] git commit: re-allow wrapping ranges for start_token/end_token range pairing patch by jbellis; reviewed by brandonwilliams for CASSANDRA-5106
Date Thu, 10 Jan 2013 18:52:17 GMT
re-allow wrapping ranges for start_token/end_token range pairing
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-5106


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

Branch: refs/heads/cassandra-1.2
Commit: ccdb632d4005165efdc65dfa3aa0a1799ae0a87b
Parents: f481a39
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Jan 10 12:50:32 2013 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Jan 10 12:50:41 2013 -0600

----------------------------------------------------------------------
 .../apache/cassandra/thrift/ThriftValidation.java  |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ccdb632d/src/java/org/apache/cassandra/thrift/ThriftValidation.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ThriftValidation.java b/src/java/org/apache/cassandra/thrift/ThriftValidation.java
index f9733d6..bc64018 100644
--- a/src/java/org/apache/cassandra/thrift/ThriftValidation.java
+++ b/src/java/org/apache/cassandra/thrift/ThriftValidation.java
@@ -507,13 +507,12 @@ public class ThriftValidation
                     throw new InvalidRequestException("start key's md5 sorts after end key's
md5.  this is not allowed; you probably should not specify end key at all, under RandomPartitioner");
             }
         }
-        else if (range.end_token != null)
+        else if (range.start_key != null && range.end_token != null)
         {
+            // start_token/end_token can wrap, but key/token should not
             RowPosition stop = p.getTokenFactory().fromString(range.end_token).maxKeyBound(p);
-            if (range.start_key != null && RowPosition.forKey(range.start_key, p).compareTo(stop)
> 0)
+            if (RowPosition.forKey(range.start_key, p).compareTo(stop) > 0)
                 throw new InvalidRequestException("Start key's token sorts after end token");
-            if (range.start_token != null && p.getTokenFactory().fromString(range.start_token).maxKeyBound(p).compareTo(stop)
> 0)
-                throw new InvalidRequestException("Start token sorts after end token");
         }
 
         validateFilterClauses(metadata, range.row_filter);


Mime
View raw message