cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [1/3] git commit: merge from 1.1
Date Tue, 03 Jul 2012 16:50:32 GMT
Updated Branches:
  refs/heads/cassandra-1.1 867478493 -> 67dec69f5
  refs/heads/trunk 76ada1106 -> 602e383d6


merge from 1.1


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

Branch: refs/heads/trunk
Commit: 602e383d670f1f2a7dd6c220482b6dc6ba57ba4b
Parents: 76ada11 67dec69
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Tue Jul 3 11:49:34 2012 -0500
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Tue Jul 3 11:49:34 2012 -0500

----------------------------------------------------------------------
 .../cassandra/db/AbstractColumnContainer.java      |    8 ++-
 .../db/AbstractThreadUnsafeSortedColumns.java      |    6 +++
 .../apache/cassandra/db/AtomicSortedColumns.java   |   31 +++++++++++++-
 .../org/apache/cassandra/db/ISortedColumns.java    |    7 +++
 src/java/org/apache/cassandra/db/Memtable.java     |   24 +++++------
 5 files changed, 57 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/602e383d/src/java/org/apache/cassandra/db/AbstractColumnContainer.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/602e383d/src/java/org/apache/cassandra/db/AbstractThreadUnsafeSortedColumns.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/602e383d/src/java/org/apache/cassandra/db/AtomicSortedColumns.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/AtomicSortedColumns.java
index a85b41e,9cb44d2..c8f5f3a
--- a/src/java/org/apache/cassandra/db/AtomicSortedColumns.java
+++ b/src/java/org/apache/cassandra/db/AtomicSortedColumns.java
@@@ -172,8 -176,11 +179,9 @@@ public class AtomicSortedColumns implem
          main_loop:
          do
          {
+             sizeDelta = 0;
              current = ref.get();
 -            DeletionInfo newDelInfo = current.deletionInfo;
 -            if (newDelInfo.markedForDeleteAt < cm.getDeletionInfo().markedForDeleteAt)
 -                newDelInfo = cm.getDeletionInfo();
 +            DeletionInfo newDelInfo = current.deletionInfo.add(cm.getDeletionInfo());
              modified = new Holder(current.map.clone(), newDelInfo);
  
              for (IColumn column : cm.getSortedColumns())
@@@ -329,12 -343,22 +339,22 @@@
          {
              ByteBuffer name = column.name();
              IColumn oldColumn;
-             while ((oldColumn = map.putIfAbsent(name, column)) != null)
+             long sizeDelta = 0;
+             while (true)
              {
+                 oldColumn = map.putIfAbsent(name, column);
+                 if (oldColumn == null)
+                 {
 -                    sizeDelta += column.serializedSize();
++                    sizeDelta += column.dataSize();
+                     break;
+                 }
+ 
                  if (oldColumn instanceof SuperColumn)
                  {
                      assert column instanceof SuperColumn;
 -                    long previousSize = oldColumn.serializedSize();
++                    long previousSize = oldColumn.dataSize();
                      ((SuperColumn) oldColumn).putColumn((SuperColumn)column, allocator);
 -                    sizeDelta += oldColumn.serializedSize() - previousSize;
++                    sizeDelta += oldColumn.dataSize() - previousSize;
                      break;  // Delegated to SuperColumn
                  }
                  else
@@@ -342,7 -366,10 +362,10 @@@
                      // calculate reconciled col from old (existing) col and new col
                      IColumn reconciledColumn = column.reconcile(oldColumn, allocator);
                      if (map.replace(name, oldColumn, reconciledColumn))
+                     {
 -                        sizeDelta += reconciledColumn.serializedSize() - oldColumn.serializedSize();
++                        sizeDelta += reconciledColumn.dataSize() - oldColumn.dataSize();
                          break;
+                     }
  
                      // We failed to replace column due to a concurrent update or a concurrent
removal. Keep trying.
                      // (Currently, concurrent removal should not happen (only updates),
but let us support that anyway.)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/602e383d/src/java/org/apache/cassandra/db/ISortedColumns.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/602e383d/src/java/org/apache/cassandra/db/Memtable.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/db/Memtable.java
index 0f9c2ed,347b997..15be9b8
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@@ -120,7 -120,9 +120,7 @@@ public class Memtabl
  
      public long getLiveSize()
      {
-         return (long) (currentThroughput.get() * cfs.liveRatio);
 -        // 25% fudge factor on the base throughput * liveRatio calculation.  (Based on observed
 -        // pre-slabbing behavior -- not sure what accounts for this. May have changed with
introduction of slabbing.)
 -        return (long) (currentSize.get() * cfs.liveRatio * 1.25);
++        return (long) (currentSize.get() * cfs.liveRatio);
      }
  
      public long getSerializedSize()


Mime
View raw message