cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mish...@apache.org
Subject [1/5] git commit: Abort liveRatio calculation if the memtable is flushed patch by Oleg Anastasyev; reviewed by jbellis for CASSANDRA-8164
Date Wed, 05 Nov 2014 23:41:46 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.1 a9f65bcf2 -> 851502902
  refs/heads/trunk 19c2d22e9 -> 8856934fc


Abort liveRatio calculation if the memtable is flushed
patch by Oleg Anastasyev; reviewed by jbellis for CASSANDRA-8164


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

Branch: refs/heads/trunk
Commit: 65f7990085230dd9da9bbae584c6502c8b6c8bf3
Parents: 89257bc
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Nov 5 16:45:01 2014 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Nov 5 16:45:01 2014 -0600

----------------------------------------------------------------------
 CHANGES.txt                                    | 1 +
 src/java/org/apache/cassandra/db/Memtable.java | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/65f79900/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index d5f607f..a469bbf 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.12:
+ * Abort liveRatio calculation if the memtable is flushed (CASSANDRA-8164)
  * Correctly handle non-text column names in cql3 (CASSANDRA-8178)
  * Fix deletion for indexes on primary key columns (CASSANDRA-8206)
  * Add 'nodetool statusgossip' (CASSANDRA-8125)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/65f79900/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 0d55bb2..0b186dc 100644
--- a/src/java/org/apache/cassandra/db/Memtable.java
+++ b/src/java/org/apache/cassandra/db/Memtable.java
@@ -450,6 +450,12 @@ public class Memtable
                 {
                     deepSize += memtable.meter.measureDeep(entry.getKey()) + memtable.meter.measureDeep(entry.getValue());
                     objects += entry.getValue().getColumnCount();
+
+                    if (memtable != cfs.getMemtableThreadSafe())
+                    {
+                        // this memtable is flushing or already flushed
+                        return;
+                    }
                 }
                 double newRatio = (double) deepSize / memtable.currentSize.get();
 


Mime
View raw message