Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
        
src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java


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

Branch: refs/heads/trunk
Commit: 5674a96d4c5d9022bf5f4fcecff97d21036882ca
Parents: fb95309 bd3c47c
Author: Tyler Hobbs <[email protected]>
Authored: Thu Jan 8 14:41:01 2015 -0600
Committer: Tyler Hobbs <[email protected]>
Committed: Thu Jan 8 14:41:01 2015 -0600

----------------------------------------------------------------------
 .../apache/cassandra/db/index/composites/CompositesSearcher.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5674a96d/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
----------------------------------------------------------------------
diff --cc 
src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
index 5c1abc9,b978021..8483c15
--- a/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
+++ b/src/java/org/apache/cassandra/db/index/composites/CompositesSearcher.java
@@@ -245,22 -226,13 +245,23 @@@ public class CompositesSearcher extend
                              }
                          }
  
 -                        // Check if this entry cannot be a hit due to the 
original column filter
 -                        ByteBuffer start = entry.indexedEntryStart();
 -                        if 
(!filter.columnFilter(dk.key).maySelectPrefix(baseComparator, start))
 +                        // Check if this entry cannot be a hit due to the 
original cell filter
 +                        Composite start = entry.indexedEntryPrefix;
 +                        if 
(!filter.columnFilter(dk.getKey()).maySelectPrefix(baseComparator, start))
                              continue;
  
 +                        // If we've record the previous prefix, it means 
we're dealing with an index on the collection value. In
 +                        // that case, we can have multiple index prefix for 
the same CQL3 row. In that case, we want to only add
 +                        // the CQL3 row once (because requesting the data 
multiple time would be inefficient but more importantly
 +                        // because we shouldn't count the columns multiple 
times with the lastCounted() call at the end of this
 +                        // method).
 +                        if (previousPrefix != null && 
previousPrefix.equals(start))
 +                            continue;
 +                        else
 +                            previousPrefix = null;
 +
-                         logger.trace("Adding index hit to current row for 
{}", indexComparator.getString(cell.name()));
+                         if (logger.isTraceEnabled())
 -                            logger.trace("Adding index hit to current row for 
{}", indexComparator.getString(column.name()));
++                            logger.trace("Adding index hit to current row for 
{}", indexComparator.getString(cell.name()));
  
                          // We always query the whole CQL3 row. In the case 
where the original filter was a name filter this might be
                          // slightly wasteful, but this probably doesn't 
matter in practice and it simplify things.

Reply via email to