You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by xe...@apache.org on 2012/06/01 23:33:48 UTC

[7/7] git commit: Take supercolumn names and deletion info into account in memtable throughput

Take supercolumn names and deletion info into account in memtable throughput

patch by slebresne; reviewed by jbellis for CASSANDRA-4264


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

Branch: refs/heads/trunk
Commit: 5c275310f95637f6cc49aefe2154503b743bac94
Parents: 2247054
Author: Sylvain Lebresne <sy...@datastax.com>
Authored: Fri Jun 1 17:36:09 2012 +0200
Committer: Sylvain Lebresne <sy...@datastax.com>
Committed: Fri Jun 1 17:36:09 2012 +0200

----------------------------------------------------------------------
 CHANGES.txt                                       |    2 ++
 src/java/org/apache/cassandra/db/SuperColumn.java |   14 +++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/5c275310/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index b9f2ad1..0f64565 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -68,6 +68,8 @@
  * (cql3) Allow keyspace properties to contain hyphens (CASSANDRA-4278)
  * (cql3) Correctly validate keyspace access in create table (CASSANDRA-4296)
  * Avoid deadlock in migration stage (CASSANDRA-3882)
+ * Take supercolumn names and deletion info into account in memtable throughput
+   (CASSANDRA-4264)
 Merged from 1.0:
  * Fix super columns bug where cache is not updated (CASSANDRA-4190)
  * fix maxTimestamp to include row tombstones (CASSANDRA-4116)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/5c275310/src/java/org/apache/cassandra/db/SuperColumn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/SuperColumn.java b/src/java/org/apache/cassandra/db/SuperColumn.java
index 67d1d71..ff35eb4 100644
--- a/src/java/org/apache/cassandra/db/SuperColumn.java
+++ b/src/java/org/apache/cassandra/db/SuperColumn.java
@@ -105,12 +105,7 @@ public class SuperColumn extends AbstractColumnContainer implements IColumn
      */
     public int size()
     {
-        int size = 0;
-        for (IColumn subColumn : getSubColumns())
-        {
-            size += subColumn.serializedSize();
-        }
-        return size;
+        return serializedSize();
     }
 
     /**
@@ -123,7 +118,12 @@ public class SuperColumn extends AbstractColumnContainer implements IColumn
     	 * We need to keep the way we are calculating the column size in sync with the
     	 * way we are calculating the size for the column family serializer.
     	 */
-      return DBConstants.shortSize + name.remaining() + DBConstants.intSize + DBConstants.longSize + DBConstants.intSize + size();
+        int size = DBConstants.shortSize + name.remaining() + DBConstants.intSize + DBConstants.longSize + DBConstants.intSize;
+        for (IColumn subColumn : getSubColumns())
+        {
+            size += subColumn.serializedSize();
+        }
+        return size;
     }
 
     public long timestamp()