cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [5/10] git commit: Merge branch 'cassandra-1.1' into cassandra-1.2.0
Date Thu, 27 Dec 2012 20:45:43 GMT
Merge branch 'cassandra-1.1' into cassandra-1.2.0


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

Branch: refs/heads/cassandra-1.2
Commit: 4b9d927d3afd66581ca5e232e3c4ef76f5aaab98
Parents: 65b377f 8a3b291
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Thu Dec 27 15:41:32 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Thu Dec 27 15:43:54 2012 -0500

----------------------------------------------------------------------
 .../apache/cassandra/thrift/ThriftValidation.java  |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4b9d927d/src/java/org/apache/cassandra/thrift/ThriftValidation.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/thrift/ThriftValidation.java
index 3912e82,de1ce56..6473acd
--- a/src/java/org/apache/cassandra/thrift/ThriftValidation.java
+++ b/src/java/org/apache/cassandra/thrift/ThriftValidation.java
@@@ -465,21 -491,30 +465,30 @@@ public class ThriftValidatio
  
          // (key, token) is supported (for wide-row CFRR) but not (token, key)
          if (range.start_token != null && range.end_key != null)
 -            throw new InvalidRequestException("start token + end key is not a supported
key range");
 +            throw new org.apache.cassandra.exceptions.InvalidRequestException("start token
+ end key is not a supported key range");
  
+         IPartitioner p = StorageService.getPartitioner();
+ 
          if (range.start_key != null && range.end_key != null)
          {
-             IPartitioner p = StorageService.getPartitioner();
              Token startToken = p.getToken(range.start_key);
              Token endToken = p.getToken(range.end_key);
              if (startToken.compareTo(endToken) > 0 && !endToken.isMinimum(p))
              {
                  if (p instanceof RandomPartitioner)
 -                    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");
 +                    throw new org.apache.cassandra.exceptions.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
 -                    throw new InvalidRequestException("start key must sort before (or equal
to) finish key in your partitioner!");
 +                    throw new org.apache.cassandra.exceptions.InvalidRequestException("start
key must sort before (or equal to) finish key in your partitioner!");
              }
          }
+         else if (range.end_token != null)
+         {
+             RowPosition stop = p.getTokenFactory().fromString(range.end_token).maxKeyBound(p);
+             if (range.start_key != null && RowPosition.forKey(range.start_key, p).compareTo(stop)
> 0)
 -                throw new InvalidRequestException("Start key's token sorts after end token");
++                throw new org.apache.cassandra.exceptions.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");
++                throw new org.apache.cassandra.exceptions.InvalidRequestException("Start
token sorts after end token");
+         }
  
          validateFilterClauses(metadata, range.row_filter);
  


Mime
View raw message