cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [6/6] git commit: re-allow indexing empty column values patch by yukim; reviewed by jbellis for CASSANDRA-4031
Date Tue, 20 Mar 2012 23:05:03 GMT
re-allow indexing empty column values
patch by yukim; reviewed by jbellis for CASSANDRA-4031


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

Branch: refs/heads/cassandra-1.1
Commit: 050e61a70bc95257c45f405fdb9997512096f963
Parents: c5aa781
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Mar 20 18:04:14 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Mar 20 18:04:14 2012 -0500

----------------------------------------------------------------------
 .../org/apache/cassandra/cql/UpdateStatement.java  |    2 ++
 .../cassandra/cql3/statements/UpdateStatement.java |    2 ++
 src/java/org/apache/cassandra/db/DecoratedKey.java |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/050e61a7/src/java/org/apache/cassandra/cql/UpdateStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql/UpdateStatement.java b/src/java/org/apache/cassandra/cql/UpdateStatement.java
index d6d410a..4c2be4d 100644
--- a/src/java/org/apache/cassandra/cql/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql/UpdateStatement.java
@@ -36,6 +36,7 @@ import org.apache.cassandra.thrift.ConsistencyLevel;
 import org.apache.cassandra.thrift.InvalidRequestException;
 
 import static org.apache.cassandra.cql.QueryProcessor.validateColumn;
+import static org.apache.cassandra.cql.QueryProcessor.validateKey;
 
 import static org.apache.cassandra.thrift.ThriftValidation.validateColumnFamily;
 import static org.apache.cassandra.thrift.ThriftValidation.validateCommutativeForWrite;
@@ -185,6 +186,7 @@ public class UpdateStatement extends AbstractModification
     private IMutation mutationForKey(String keyspace, ByteBuffer key, CFMetaData metadata,
Long timestamp, ClientState clientState, List<ByteBuffer> variables)
     throws InvalidRequestException
     {
+        validateKey(key);
         AbstractType<?> comparator = getComparator(keyspace);
 
         // if true we need to wrap RowMutation into CounterMutation

http://git-wip-us.apache.org/repos/asf/cassandra/blob/050e61a7/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
index dd699f4..a1724d9 100644
--- a/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
+++ b/src/java/org/apache/cassandra/cql3/statements/UpdateStatement.java
@@ -32,6 +32,7 @@ import org.apache.cassandra.thrift.InvalidRequestException;
 import org.apache.cassandra.utils.ByteBufferUtil;
 
 import static org.apache.cassandra.cql.QueryProcessor.validateColumnName;
+import static org.apache.cassandra.cql.QueryProcessor.validateKey;
 
 import static org.apache.cassandra.thrift.ThriftValidation.validateColumnFamily;
 import static org.apache.cassandra.thrift.ThriftValidation.validateCommutativeForWrite;
@@ -148,6 +149,7 @@ public class UpdateStatement extends ModificationStatement
     private IMutation mutationForKey(CFDefinition cfDef, ClientState clientState, ByteBuffer
key, ColumnNameBuilder builder, List<ByteBuffer> variables)
     throws InvalidRequestException
     {
+        validateKey(key);
         // if true we need to wrap RowMutation into CounterMutation
         boolean hasCounterColumn = false;
         RowMutation rm = new RowMutation(cfDef.cfm.ksName, key);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/050e61a7/src/java/org/apache/cassandra/db/DecoratedKey.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DecoratedKey.java b/src/java/org/apache/cassandra/db/DecoratedKey.java
index 81ead8c..4f6c862 100644
--- a/src/java/org/apache/cassandra/db/DecoratedKey.java
+++ b/src/java/org/apache/cassandra/db/DecoratedKey.java
@@ -52,7 +52,7 @@ public class DecoratedKey<T extends Token> extends RowPosition
 
     public DecoratedKey(T token, ByteBuffer key)
     {
-        assert token != null && key != null && key.remaining() > 0;
+        assert token != null && key != null;
         this.token = token;
         this.key = key;
     }


Mime
View raw message