cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject git commit: fix get_range_slices with startkey and endtoken specified patch by Nikolay (nmmm) reviewed by dbrosius for CASSANDRA-4804
Date Wed, 17 Oct 2012 04:00:45 GMT
Updated Branches:
  refs/heads/cassandra-1.1 b8874ad1a -> 4d637f1f1


fix get_range_slices with startkey and endtoken specified
patch by Nikolay (nmmm) reviewed by dbrosius for CASSANDRA-4804


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

Branch: refs/heads/cassandra-1.1
Commit: 4d637f1f1b62593e0c52e49966e3f286bf65c3e9
Parents: b8874ad
Author: Dave Brosius <dbrosius@apache.org>
Authored: Tue Oct 16 23:56:26 2012 -0400
Committer: Dave Brosius <dbrosius@apache.org>
Committed: Tue Oct 16 23:56:26 2012 -0400

----------------------------------------------------------------------
 .../apache/cassandra/thrift/CassandraServer.java   |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/4d637f1f/src/java/org/apache/cassandra/thrift/CassandraServer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/CassandraServer.java b/src/java/org/apache/cassandra/thrift/CassandraServer.java
index a11472c..ad416f3 100644
--- a/src/java/org/apache/cassandra/thrift/CassandraServer.java
+++ b/src/java/org/apache/cassandra/thrift/CassandraServer.java
@@ -673,18 +673,20 @@ public class CassandraServer implements Cassandra.Iface
         List<Row> rows;
         try
         {
-            IPartitioner p = StorageService.getPartitioner();
+            IPartitioner<?> p = StorageService.getPartitioner();
             AbstractBounds<RowPosition> bounds;
             if (range.start_key == null)
             {
-                Token.TokenFactory tokenFactory = p.getTokenFactory();
+                Token.TokenFactory<?> tokenFactory = p.getTokenFactory();
                 Token left = tokenFactory.fromString(range.start_token);
                 Token right = tokenFactory.fromString(range.end_token);
                 bounds = Range.makeRowRange(left, right, p);
             }
             else
             {
-                bounds = new Bounds<RowPosition>(RowPosition.forKey(range.start_key,
p), RowPosition.forKey(range.end_key, p));
+                RowPosition end = range.end_key == null ? p.getTokenFactory().fromString(range.end_token).maxKeyBound(p)
+                                                    : RowPosition.forKey(range.end_key, p);
+                bounds = new Bounds<RowPosition>(RowPosition.forKey(range.start_key,
p), end);
             }
             schedule(DatabaseDescriptor.getRpcTimeout());
             try
@@ -862,7 +864,7 @@ public class CassandraServer implements Cassandra.Iface
     {
         return StorageService.instance.describeRing(keyspace);
     }
-    
+
     public Map<String, String> describe_token_map() throws InvalidRequestException
     {
         return StorageService.instance.getTokenToEndpointMap();


Mime
View raw message