cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r917762 - /incubator/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
Date Mon, 01 Mar 2010 22:28:54 GMT
Author: jbellis
Date: Mon Mar  1 22:28:53 2010
New Revision: 917762

URL: http://svn.apache.org/viewvc?rev=917762&view=rev
Log:
improve delete + slicerange invalidrequest message; clean up formatting.  patch by jbellis

Modified:
    incubator/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java

Modified: incubator/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java?rev=917762&r1=917761&r2=917762&view=diff
==============================================================================
--- incubator/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
(original)
+++ incubator/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/thrift/ThriftValidation.java
Mon Mar  1 22:28:53 2010
@@ -229,9 +229,8 @@
             }
         }
 
-        if (cosc.column == null && cosc.super_column == null) {
+        if (cosc.column == null && cosc.super_column == null)
             throw new InvalidRequestException("ColumnOrSuperColumn must have one or both
of Column or SuperColumn");
-        }
     }
 
     public static void validateMutation(String keyspace, String cfName, Mutation mut)
@@ -240,9 +239,8 @@
         ColumnOrSuperColumn cosc = mut.column_or_supercolumn;
         Deletion del = mut.deletion;
 
-        if (cosc != null && del != null) {
+        if (cosc != null && del != null)
             throw new InvalidRequestException("Mutation may have either a ColumnOrSuperColumn
or a Deletion, but not both");
-        }
 
         if (cosc != null)
         {
@@ -269,23 +267,20 @@
         {
             validateSlicePredicate(keyspace, cfName, del.super_column, del.predicate);
             if (del.predicate.slice_range != null)
-                throw new InvalidRequestException("Deletion does not yet work correctly with
SliceRanges.");
+                throw new InvalidRequestException("Deletion does not yet support SliceRange
predicates.");
         }
     }
 
     public static void validateSlicePredicate(String keyspace, String cfName, byte[] scName,
SlicePredicate predicate) throws InvalidRequestException
     {
-        if (predicate.column_names == null && predicate.slice_range == null) {
+        if (predicate.column_names == null && predicate.slice_range == null)
             throw new InvalidRequestException("A SlicePredicate must be given a list of Columns,
a SliceRange, or both");
-        }
 
-        if (predicate.slice_range != null) {
+        if (predicate.slice_range != null)
             validateRange(keyspace, createColumnParent(cfName, scName), predicate.slice_range);
-        }
 
-        if (predicate.column_names != null) {
+        if (predicate.column_names != null)
             validateColumns(keyspace, cfName, scName, predicate.column_names);
-        }
     }
 
     public static void validatePredicate(String keyspace, ColumnParent column_parent, SlicePredicate
predicate)



Mime
View raw message