You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by al...@apache.org on 2014/08/20 14:51:24 UTC

[1/3] git commit: Stop inheriting liveRatio and liveRatioComputedAt from previous memtables

Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 bd692ba74 -> fd40a6183


Stop inheriting liveRatio and liveRatioComputedAt from previous memtables

patch by Aleksey Yeschenko; reviewed by Jonathan Ellis for CASSANDRA-7796


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

Branch: refs/heads/cassandra-2.1
Commit: eeb0d4c90198b14113ee094587cf0eacceb2b96f
Parents: 76adf0e
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 15:40:27 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 15:40:27 2014 +0300

----------------------------------------------------------------------
 CHANGES.txt                                       |  2 ++
 src/java/org/apache/cassandra/db/DataTracker.java |  6 +++---
 src/java/org/apache/cassandra/db/Memtable.java    | 14 +++-----------
 3 files changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/eeb0d4c9/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index c8f7591..2b2930e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,6 @@
 2.0.10
+ * Stop inheriting liveRatio and liveRatioComputedAt from previous
+   memtables (CASSANDRA-7796)
  * Throw EOFException if we run out of chunks in compressed datafile
    (CASSANDRA-7664)
  * Throw InvalidRequestException when queries contain relations on entire

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eeb0d4c9/src/java/org/apache/cassandra/db/DataTracker.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/DataTracker.java b/src/java/org/apache/cassandra/db/DataTracker.java
index 088255e..05ee13e 100644
--- a/src/java/org/apache/cassandra/db/DataTracker.java
+++ b/src/java/org/apache/cassandra/db/DataTracker.java
@@ -109,7 +109,7 @@ public class DataTracker
     public Memtable switchMemtable()
     {
         // atomically change the current memtable
-        Memtable newMemtable = new Memtable(cfstore, view.get().memtable);
+        Memtable newMemtable = new Memtable(cfstore);
         Memtable toFlushMemtable;
         View currentView, newView;
         do
@@ -132,7 +132,7 @@ public class DataTracker
     {
         assert !cfstore.keyspace.metadata.durableWrites;
 
-        Memtable newMemtable = new Memtable(cfstore, view.get().memtable);
+        Memtable newMemtable = new Memtable(cfstore);
         View currentView, newView;
         do
         {
@@ -323,7 +323,7 @@ public class DataTracker
     /** (Re)initializes the tracker, purging all references. */
     void init()
     {
-        view.set(new View(new Memtable(cfstore, null),
+        view.set(new View(new Memtable(cfstore),
                           Collections.<Memtable>emptySet(),
                           Collections.<SSTableReader>emptySet(),
                           Collections.<SSTableReader>emptySet(),

http://git-wip-us.apache.org/repos/asf/cassandra/blob/eeb0d4c9/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 20adeb7..f9a6719 100644
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@ -120,20 +120,12 @@ public class Memtable
     // memtable was created with the new or old comparator.
     public final AbstractType initialComparator;
 
-    public Memtable(ColumnFamilyStore cfs, Memtable previous)
+    public Memtable(ColumnFamilyStore cfs)
     {
         this.cfs = cfs;
         this.initialComparator = cfs.metadata.comparator;
         this.cfs.scheduleFlush();
 
-        // Inherit liveRatio and liveRatioCompareAt from the previous memtable, if available,
-        // to minimise recalculation frequency as much as possible.
-        if (previous != null)
-        {
-            liveRatio = previous.liveRatio;
-            liveRatioComputedAt.set(previous.liveRatioComputedAt.get() / 4);
-        }
-
         Callable<Set<Object>> provider = new Callable<Set<Object>>()
         {
             public Set<Object> call() throws Exception
@@ -175,12 +167,12 @@ public class Memtable
 
     public void maybeUpdateLiveRatio()
     {
-        // recompute liveRatio, if we have doubled the number of ops since last calculated
+        // recompute liveRatio, if we have increased the number of ops 10x since last calculated
         while (true)
         {
             long last = liveRatioComputedAt.get();
             long operations = currentOperations.get();
-            if (operations <= 2L * last)
+            if (operations <= 10L * last)
                 break;
             if (liveRatioComputedAt.compareAndSet(last, operations))
             {


[3/3] git commit: Merge branch 'cassandra-2.1.0' into cassandra-2.1

Posted by al...@apache.org.
Merge branch 'cassandra-2.1.0' into cassandra-2.1


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

Branch: refs/heads/cassandra-2.1
Commit: fd40a6183c3005968c96847e4122ea4690c45c1d
Parents: bd692ba c8a8bfc
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 15:51:12 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 15:51:12 2014 +0300

----------------------------------------------------------------------

----------------------------------------------------------------------



[2/3] git commit: Merge branch 'cassandra-2.0' into cassandra-2.1.0

Posted by al...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1.0

Conflicts:
	CHANGES.txt
	src/java/org/apache/cassandra/db/DataTracker.java
	src/java/org/apache/cassandra/db/Memtable.java


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

Branch: refs/heads/cassandra-2.1
Commit: c8a8bfc1e7e89ea27143660c2d738f7fc2ea1a13
Parents: 39b8196 eeb0d4c
Author: Aleksey Yeschenko <al...@apache.org>
Authored: Wed Aug 20 15:47:37 2014 +0300
Committer: Aleksey Yeschenko <al...@apache.org>
Committed: Wed Aug 20 15:47:37 2014 +0300

----------------------------------------------------------------------

----------------------------------------------------------------------