cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject cassandra git commit: add SASI validation for partitioner and complex columns
Date Wed, 17 Feb 2016 21:57:30 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 186777aac -> 27ac6a836


add SASI validation for partitioner and complex columns

patch by xedin; reviewed by jasobrown for CASSANDRA-11169


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

Branch: refs/heads/trunk
Commit: 27ac6a836228d66c32ade3c7ba9da3483ff31f27
Parents: 186777a
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Tue Feb 16 19:17:38 2016 -0800
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Wed Feb 17 13:52:59 2016 -0800

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/index/sasi/SASIIndex.java | 7 +++++++
 2 files changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ac6a83/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f3248df..df97bbd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.4
+ * add SASI validation for partitioner and complex columns (CASSANDRA-11169)
  * Add caching of encrypted credentials in PasswordAuthenticator (CASSANDRA-7715)
  * fix SASI memtable switching on flush (CASSANDRA-11159)
  * Remove duplicate offline compaction tracking (CASSANDRA-11148)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27ac6a83/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/index/sasi/SASIIndex.java b/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
index 90cc72e..0b9d900 100644
--- a/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
+++ b/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
@@ -35,6 +35,7 @@ import org.apache.cassandra.db.marshal.AbstractType;
 import org.apache.cassandra.db.partitions.PartitionIterator;
 import org.apache.cassandra.db.partitions.PartitionUpdate;
 import org.apache.cassandra.db.rows.Row;
+import org.apache.cassandra.dht.Murmur3Partitioner;
 import org.apache.cassandra.exceptions.ConfigurationException;
 import org.apache.cassandra.exceptions.InvalidRequestException;
 import org.apache.cassandra.index.Index;
@@ -121,6 +122,9 @@ public class SASIIndex implements Index, INotificationConsumer
 
     public static Map<String, String> validateOptions(Map<String, String> options,
CFMetaData cfm)
     {
+        if (!(cfm.partitioner instanceof Murmur3Partitioner))
+            throw new ConfigurationException("SASI only supports Murmur3Partitioner.");
+
         String targetColumn = options.get("target");
         if (targetColumn == null)
             throw new ConfigurationException("unknown target column");
@@ -129,6 +133,9 @@ public class SASIIndex implements Index, INotificationConsumer
         if (target == null)
             throw new ConfigurationException("failed to retrieve target column for: " + targetColumn);
 
+        if (target.left.isComplex())
+            throw new ConfigurationException("complex columns are not yet supported by SASI");
+
         IndexMode.validateAnalyzer(options);
 
         IndexMode mode = IndexMode.getMode(target.left, options);


Mime
View raw message