cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject git commit: Follow-up for 6327
Date Thu, 14 Nov 2013 08:31:15 GMT
Updated Branches:
  refs/heads/cassandra-2.0 1d3a4dd44 -> 731f58fcd


Follow-up for 6327

patch by krummas; reviewed by slebresne for CASSANDRA-6327


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

Branch: refs/heads/cassandra-2.0
Commit: 731f58fcd9d7e9810069de2d3ba9516b784afd34
Parents: 1d3a4dd
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Thu Nov 14 09:26:43 2013 +0100
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Thu Nov 14 09:28:44 2013 +0100

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/marshal/CompositeType.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/731f58fc/src/java/org/apache/cassandra/db/marshal/CompositeType.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/marshal/CompositeType.java b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
index c9e2ab9..5c1b62a 100644
--- a/src/java/org/apache/cassandra/db/marshal/CompositeType.java
+++ b/src/java/org/apache/cassandra/db/marshal/CompositeType.java
@@ -220,8 +220,11 @@ public class CompositeType extends AbstractCompositeType
     public boolean intersects(List<ByteBuffer> minColumnNames, List<ByteBuffer>
maxColumnNames, SliceQueryFilter filter)
     {
         assert minColumnNames.size() == maxColumnNames.size();
+        outer:
         for (ColumnSlice slice : filter.slices)
         {
+            // This slices intersects if all component intersect. And we don't intersect
+            // only if no slice intersects
             ByteBuffer[] start = split(filter.isReversed() ? slice.finish : slice.start);
             ByteBuffer[] finish = split(filter.isReversed() ? slice.start : slice.finish);
             for (int i = 0; i < minColumnNames.size(); i++)
@@ -229,9 +232,10 @@ public class CompositeType extends AbstractCompositeType
                 AbstractType<?> t = types.get(i);
                 ByteBuffer s = i < start.length ? start[i] : ByteBufferUtil.EMPTY_BYTE_BUFFER;
                 ByteBuffer f = i < finish.length ? finish[i] : ByteBufferUtil.EMPTY_BYTE_BUFFER;
-                if (t.intersects(minColumnNames.get(i), maxColumnNames.get(i), s, f))
-                    return true;
+                if (!t.intersects(minColumnNames.get(i), maxColumnNames.get(i), s, f))
+                    continue outer;
             }
+            return true;
         }
         return false;
     }


Mime
View raw message