cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xe...@apache.org
Subject cassandra git commit: remove redundant SASI index existence check from validateOptions
Date Wed, 10 Feb 2016 22:11:20 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk f8e86eb34 -> 7709c2a7f


remove redundant SASI index existence check from validateOptions

patch by xedin; reviewed by beobal for CASSANDRA-11136


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

Branch: refs/heads/trunk
Commit: 7709c2a7f5e88a6b93410bfa8f9673cd04416ed5
Parents: f8e86eb
Author: Pavel Yaskevich <xedin@apache.org>
Authored: Wed Feb 10 13:45:48 2016 -0800
Committer: Pavel Yaskevich <xedin@apache.org>
Committed: Wed Feb 10 13:58:03 2016 -0800

----------------------------------------------------------------------
 .../org/apache/cassandra/index/sasi/SASIIndex.java     |  8 --------
 .../org/apache/cassandra/index/sasi/SASIIndexTest.java | 13 -------------
 2 files changed, 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7709c2a7/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 b460910..d480b82 100644
--- a/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
+++ b/src/java/org/apache/cassandra/index/sasi/SASIIndex.java
@@ -141,14 +141,6 @@ public class SASIIndex implements Index, INotificationConsumer
                 throw new ConfigurationException("SPARSE mode doesn't support analyzers.");
         }
 
-        ColumnFamilyStore store = Schema.instance.getColumnFamilyStoreIncludingIndexes(Pair.create(cfm.ksName,
cfm.cfName));
-        if (store != null && store.indexManager.listIndexes()
-                                               .stream()
-                                               .filter((index) -> index.dependsOn(target.left)
-                                                               && index.getClass().isAssignableFrom(SASIIndex.class))
-                                               .findFirst().isPresent())
-            throw new ConfigurationException("Index on '" + targetColumn + "' already exists,
SASI doesn't support multiple indexes per column.");
-
         return Collections.emptyMap();
     }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7709c2a7/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java b/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
index bd3bb0c..2ae1e70 100644
--- a/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
+++ b/test/unit/org/apache/cassandra/index/sasi/SASIIndexTest.java
@@ -1744,19 +1744,6 @@ public class SASIIndexTest
         {
             Assert.assertTrue(e.getMessage().contains("doesn't support analyzers"));
         }
-
-        try
-        {
-            // new index for column which already has a SASI index
-            SASIIndex.validateOptions(new HashMap<String, String>()
-                                      {{ put("target", "first_name"); put("mode", "PREFIX");
}},
-                                      store.metadata);
-            Assert.fail();
-        }
-        catch (ConfigurationException e)
-        {
-            Assert.assertTrue(e.getMessage().contains("already exists"));
-        }
     }
 
     private static ColumnFamilyStore loadData(Map<String, Pair<String, Integer>>
data, boolean forceFlush)


Mime
View raw message