cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1198828 - in /cassandra/trunk: NEWS.txt src/java/org/apache/cassandra/service/ReadCallback.java src/java/org/apache/cassandra/thrift/CassandraServer.java src/java/org/apache/cassandra/thrift/ThriftValidation.java
Date Mon, 07 Nov 2011 17:31:18 GMT
Author: jbellis
Date: Mon Nov  7 17:31:17 2011
New Revision: 1198828

URL: http://svn.apache.org/viewvc?rev=1198828&view=rev
Log:
reject CL.ANY range scans as well as single/multi-row gets
patch by jbellis; reviewed by slebresne for CASSANDRA-3410

Modified:
    cassandra/trunk/NEWS.txt
    cassandra/trunk/src/java/org/apache/cassandra/service/ReadCallback.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
    cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java

Modified: cassandra/trunk/NEWS.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/NEWS.txt?rev=1198828&r1=1198827&r2=1198828&view=diff
==============================================================================
--- cassandra/trunk/NEWS.txt (original)
+++ cassandra/trunk/NEWS.txt Mon Nov  7 17:31:17 2011
@@ -6,6 +6,10 @@ Upgrading
     - EACH_QUORUM ConsistencyLevel is only supported for writes and will now
       throw an InvalidRequestException when used for reads.  (Previous
       versions would silently perform a LOCAL_QUORUM read instead.)
+    - ANY ConsistencyLevel is only supported for writes and will now
+      throw an InvalidRequestException when used for reads.  (Previous
+      versions would silently perform a ONE read for range queries;
+      single-row and multiget reads already rejected ANY.)
 
 
 1.0.1

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/ReadCallback.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/ReadCallback.java?rev=1198828&r1=1198827&r2=1198828&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/ReadCallback.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/ReadCallback.java Mon Nov  7 17:31:17
2011
@@ -182,7 +182,6 @@ public class ReadCallback<T> implements 
         switch (consistencyLevel)
         {
             case ONE:
-            case ANY:
                 return 1;
             case TWO:
                 return 2;

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java?rev=1198828&r1=1198827&r2=1198828&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/CassandraServer.java Mon Nov  7 17:31:17
2011
@@ -120,11 +120,6 @@ public class CassandraServer implements 
         // TODO - Support multiple column families per row, right now row only contains 1
column family
         Map<DecoratedKey, ColumnFamily> columnFamilyKeyMap = new HashMap<DecoratedKey,
ColumnFamily>();
 
-        if (consistency_level == ConsistencyLevel.ANY)
-        {
-            throw new InvalidRequestException("Consistency level any may not be applied to
read operations");
-        }
-
         List<Row> rows;
         try
         {

Modified: cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java?rev=1198828&r1=1198827&r2=1198828&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/thrift/ThriftValidation.java Mon Nov  7
17:31:17 2011
@@ -91,6 +91,10 @@ public class ThriftValidation
     {
         switch (cl)
         {
+            case ANY:
+                if (requestType == RequestType.READ)
+                    throw new InvalidRequestException("ANY ConsistencyLevel is only supported
for writes");
+                break;
             case LOCAL_QUORUM:
                 requireNetworkTopologyStrategy(table, cl);
                 break;



Mime
View raw message