Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A577C17322 for ; Sat, 19 Sep 2015 18:22:29 +0000 (UTC) Received: (qmail 34972 invoked by uid 500); 19 Sep 2015 18:22:29 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 34844 invoked by uid 500); 19 Sep 2015 18:22:29 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 34818 invoked by uid 99); 19 Sep 2015 18:22:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Sep 2015 18:22:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 12C60DFD87; Sat, 19 Sep 2015 18:22:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: samt@apache.org To: commits@cassandra.apache.org Date: Sat, 19 Sep 2015 18:22:30 -0000 Message-Id: <1f4a773f7f85484194803e3bc9db9e00@git.apache.org> In-Reply-To: <350ee6ef1c884530ad680432282ff533@git.apache.org> References: <350ee6ef1c884530ad680432282ff533@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/3] cassandra git commit: Fix parsing of index targets in thrift metadata conversion 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 Authored: Sat Sep 19 19:15:39 2015 +0100 Committer: Sam Tunnicliffe 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 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)