cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [2/5] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1
Date Tue, 01 Apr 2014 09:30:15 GMT
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	src/java/org/apache/cassandra/db/filter/ColumnCounter.java


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

Branch: refs/heads/trunk
Commit: 6776136a66a08636b2ddde7e75b39651460fb0ae
Parents: 26191ca abc6565
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Tue Apr 1 11:09:25 2014 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Tue Apr 1 11:09:25 2014 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/db/filter/ColumnCounter.java      | 28 ++++++++++++++------
 2 files changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6776136a/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6776136a/src/java/org/apache/cassandra/db/filter/ColumnCounter.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/filter/ColumnCounter.java
index 982cd62,83b138c..b8a9563
--- a/src/java/org/apache/cassandra/db/filter/ColumnCounter.java
+++ b/src/java/org/apache/cassandra/db/filter/ColumnCounter.java
@@@ -73,9 -75,10 +73,9 @@@ public class ColumnCounte
  
      public static class GroupByPrefix extends ColumnCounter
      {
 -        private final CompositeType type;
 +        private final CellNameType type;
          private final int toGroup;
-         private CellName last;
 -        private ByteBuffer[] previous;
 -        private boolean previousGroupIsStatic;
++        private CellName previous;
  
          /**
           * A column counter that count only 1 for all the columns sharing a
@@@ -110,23 -113,37 +110,35 @@@
                  return;
              }
  
 -            ByteBuffer[] current = type.split(column.name());
 -            assert current.length >= toGroup;
 +            CellName current = cell.name();
 +            assert current.size() >= toGroup;
  
-             if (last != null)
 -            if (previous == null)
 -            {
 -                // Only the first group can be static
 -                previousGroupIsStatic = type.isStaticName(column.name());
 -            }
 -            else
++            if (previous != null)
              {
--                boolean isSameGroup = true;
--                for (int i = 0; i < toGroup; i++)
++                boolean isSameGroup = previous.isStatic() == current.isStatic();
++                if (isSameGroup)
                  {
-                     if (type.subtype(i).compare(last.get(i), current.get(i)) != 0)
 -                    if (ByteBufferUtil.compareUnsigned(previous[i], current[i]) != 0)
++                    for (int i = 0; i < toGroup; i++)
                      {
--                        isSameGroup = false;
--                        break;
++                        if (type.subtype(i).compare(previous.get(i), current.get(i)) !=
0)
++                        {
++                            isSameGroup = false;
++                            break;
++                        }
                      }
                  }
  
                  if (isSameGroup)
                      return;
+ 
+                 // We want to count the static group as 1 (CQL) row only if it's the only
+                 // group in the partition. So, since we have already counted it at this
point,
+                 // just don't count the 2nd group if there is one and the first one was
static
 -                if (previousGroupIsStatic)
++                if (previous.isStatic())
+                 {
 -                    previousGroupIsStatic = false;
++                    previous = current;
+                     return;
+                 }
              }
  
              live++;


Mime
View raw message