cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/2] git commit: rename size -> dataSize
Date Tue, 15 May 2012 04:05:39 GMT
rename size -> dataSize


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

Branch: refs/heads/trunk
Commit: 6633eb4ebc20265cea41d017d29dbd911dd49e25
Parents: 19ce000
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Mon May 14 18:17:53 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Mon May 14 23:05:03 2012 -0500

----------------------------------------------------------------------
 src/java/org/apache/cassandra/db/Column.java       |    4 ++--
 src/java/org/apache/cassandra/db/ColumnFamily.java |    5 +++--
 .../org/apache/cassandra/db/CounterColumn.java     |    4 ++--
 .../org/apache/cassandra/db/ExpiringColumn.java    |    4 ++--
 src/java/org/apache/cassandra/db/IColumn.java      |    2 +-
 src/java/org/apache/cassandra/db/Memtable.java     |    2 +-
 src/java/org/apache/cassandra/db/SuperColumn.java  |    4 ++--
 7 files changed, 13 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/src/java/org/apache/cassandra/db/Column.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Column.java b/src/java/org/apache/cassandra/db/Column.java
index e4fd5b1..c0c6dfb 100644
--- a/src/java/org/apache/cassandra/db/Column.java
+++ b/src/java/org/apache/cassandra/db/Column.java
@@ -124,7 +124,7 @@ public class Column implements IColumn
         return timestamp;
     }
 
-    public int size(TypeSizes typeSizes)
+    public int dataSize(TypeSizes typeSizes)
     {
         /*
          * Size of a column is =
@@ -145,7 +145,7 @@ public class Column implements IColumn
     */
     public int serializedSize(TypeSizes typeSizes)
     {
-        return size(typeSizes);
+        return dataSize(typeSizes);
     }
 
     public int serializationFlags()

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/src/java/org/apache/cassandra/db/ColumnFamily.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ColumnFamily.java b/src/java/org/apache/cassandra/db/ColumnFamily.java
index 02964a0..d5c4c76 100644
--- a/src/java/org/apache/cassandra/db/ColumnFamily.java
+++ b/src/java/org/apache/cassandra/db/ColumnFamily.java
@@ -249,12 +249,13 @@ public class ColumnFamily extends AbstractColumnContainer implements
IRowCacheEn
         return null;
     }
 
-    int size(TypeSizes typeSizes)
+    /** the size of user-provided data, not including internal overhead */
+    int dataSize(TypeSizes typeSizes)
     {
         int size = TypeSizes.NATIVE.sizeof(1L) + TypeSizes.NATIVE.sizeof(1); // tombstone
tracking
         for (IColumn column : columns)
         {
-            size += column.size(typeSizes);
+            size += column.dataSize(typeSizes);
         }
         return size;
     }

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/src/java/org/apache/cassandra/db/CounterColumn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/CounterColumn.java b/src/java/org/apache/cassandra/db/CounterColumn.java
index 8845c42..d081959 100644
--- a/src/java/org/apache/cassandra/db/CounterColumn.java
+++ b/src/java/org/apache/cassandra/db/CounterColumn.java
@@ -93,13 +93,13 @@ public class CounterColumn extends Column
     }
 
     @Override
-    public int size(TypeSizes typeSizes)
+    public int dataSize(TypeSizes typeSizes)
     {
         /*
          * A counter column adds to a Column :
          *  + 8 bytes for timestampOfLastDelete
          */
-        return super.size(typeSizes) + typeSizes.sizeof(timestampOfLastDelete);
+        return super.dataSize(typeSizes) + typeSizes.sizeof(timestampOfLastDelete);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/src/java/org/apache/cassandra/db/ExpiringColumn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/ExpiringColumn.java b/src/java/org/apache/cassandra/db/ExpiringColumn.java
index 74935a2..f2f41b2 100644
--- a/src/java/org/apache/cassandra/db/ExpiringColumn.java
+++ b/src/java/org/apache/cassandra/db/ExpiringColumn.java
@@ -74,14 +74,14 @@ public class ExpiringColumn extends Column
     }
 
     @Override
-    public int size(TypeSizes typeSizes)
+    public int dataSize(TypeSizes typeSizes)
     {
         /*
          * An expired column adds to a Column :
          *    4 bytes for the localExpirationTime
          *  + 4 bytes for the timeToLive
         */
-        return super.size(typeSizes) + typeSizes.sizeof(localExpirationTime) + typeSizes.sizeof(timeToLive);
+        return super.dataSize(typeSizes) + typeSizes.sizeof(localExpirationTime) + typeSizes.sizeof(timeToLive);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/src/java/org/apache/cassandra/db/IColumn.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/IColumn.java b/src/java/org/apache/cassandra/db/IColumn.java
index fd48a87..9d7279c 100644
--- a/src/java/org/apache/cassandra/db/IColumn.java
+++ b/src/java/org/apache/cassandra/db/IColumn.java
@@ -42,7 +42,7 @@ public interface IColumn
     public long mostRecentLiveChangeAt();
     public long mostRecentNonGCableChangeAt(int gcbefore);
     public ByteBuffer name();
-    public int size(TypeSizes typeSizes);
+    public int dataSize(TypeSizes typeSizes);
     public int serializedSize(TypeSizes typeSizes);
     public int serializationFlags();
     public long timestamp();

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/src/java/org/apache/cassandra/db/Memtable.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/Memtable.java b/src/java/org/apache/cassandra/db/Memtable.java
index da795a6..0d38160 100644
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@ -225,7 +225,7 @@ public class Memtable
 
     private void resolve(DecoratedKey key, ColumnFamily cf)
     {
-        currentThroughput.addAndGet(cf.size(TypeSizes.NATIVE));
+        currentThroughput.addAndGet(cf.dataSize(TypeSizes.NATIVE));
         currentOperations.addAndGet((cf.getColumnCount() == 0)
                                     ? cf.isMarkedForDelete() ? 1 : 0
                                     : cf.getColumnCount());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/6633eb4e/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 15cc901..9098446 100644
--- a/src/java/org/apache/cassandra/db/SuperColumn.java
+++ b/src/java/org/apache/cassandra/db/SuperColumn.java
@@ -102,7 +102,7 @@ public class SuperColumn extends AbstractColumnContainer implements IColumn
     /**
      * This calculates the exact size of the sub columns on the fly
      */
-    public int size(TypeSizes typeSizes)
+    public int dataSize(TypeSizes typeSizes)
     {
         int size = 0;
         for (IColumn subColumn : getSubColumns())
@@ -130,7 +130,7 @@ public class SuperColumn extends AbstractColumnContainer implements IColumn
          * size(constantSize) of subcolumns.
          */
         int nameSize = name.remaining();
-        int subColumnsSize = size(typeSizes);
+        int subColumnsSize = dataSize(typeSizes);
         return typeSizes.sizeof((short) nameSize) + nameSize
                 + typeSizes.sizeof(getLocalDeletionTime())
                 + typeSizes.sizeof(getMarkedForDeleteAt())


Mime
View raw message