cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [2/3] cassandra git commit: Fix parsing of index targets in thrift metadata conversion
Date Sat, 19 Sep 2015 18:22:30 GMT
Fix parsing of index targets in thrift metadata conversion


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

Branch: refs/heads/trunk
Commit: d6e14b34b0dad387140da3fef8522b3cd215e6d6
Parents: aba97fc
Author: Sam Tunnicliffe <sam@beobal.com>
Authored: Sat Sep 19 19:15:39 2015 +0100
Committer: Sam Tunnicliffe <sam@beobal.com>
Committed: Sat Sep 19 19:19:03 2015 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/thrift/ThriftConversion.java | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d6e14b34/src/java/org/apache/cassandra/thrift/ThriftConversion.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/thrift/ThriftConversion.java b/src/java/org/apache/cassandra/thrift/ThriftConversion.java
index 005d6c5..3794fe0 100644
--- a/src/java/org/apache/cassandra/thrift/ThriftConversion.java
+++ b/src/java/org/apache/cassandra/thrift/ThriftConversion.java
@@ -42,6 +42,7 @@ import org.apache.cassandra.locator.LocalStrategy;
 import org.apache.cassandra.schema.*;
 import org.apache.cassandra.serializers.MarshalException;
 import org.apache.cassandra.utils.ByteBufferUtil;
+import org.apache.cassandra.utils.Pair;
 import org.apache.cassandra.utils.UUIDGen;
 
 /**
@@ -590,10 +591,8 @@ public class ThriftConversion
         IndexMetadata matchedIndex = null;
         for (IndexMetadata index : cfMetaData.getIndexes())
         {
-            String target = index.options.get(IndexTarget.TARGET_OPTION_NAME);
-            Matcher m = CassandraIndex.TARGET_REGEX.matcher(target);
-            if (target.equals(column.name.toString()) ||
-                (m.matches() && m.group(2).equals(column.name.toString())))
+            Pair<ColumnDefinition, IndexTarget.Type> target  = CassandraIndex.parseTarget(cfMetaData,
index);
+            if (target.left.equals(column))
             {
                 // we already found an index for this column, we've no option but to
                 // ignore both of them (and any others we've yet to find)


Mime
View raw message