cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1028360 - in /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db: ColumnFamilyStore.java Memtable.java
Date Thu, 28 Oct 2010 16:06:05 GMT
Author: jbellis
Date: Thu Oct 28 16:06:05 2010
New Revision: 1028360

URL: http://svn.apache.org/viewvc?rev=1028360&view=rev
Log:
log which memtable threshold caused flush.  patch by Rob Coli; reviewed by jbellis for CASSANDRA-1675

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Memtable.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=1028360&r1=1028359&r2=1028360&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
Thu Oct 28 16:06:05 2010
@@ -682,7 +682,11 @@ public class ColumnFamilyStore implement
     public void forceFlushIfExpired()
     {
         if (memtable.isExpired())
+        {
+            logger.info("Memtable for {} has reached memtable_flush_after_mins {}, enqueueing
flush",
+                        memtable.cfs.getColumnFamilyName(), memtable.cfs.getMemtableFlushAfterMins());
             forceFlush();
+        }
     }
 
     public Future<?> forceFlush()

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Memtable.java?rev=1028360&r1=1028359&r2=1028360&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/db/Memtable.java Thu Oct
28 16:06:05 2010
@@ -99,7 +99,20 @@ public class Memtable implements Compara
 
     boolean isThresholdViolated()
     {
-        return currentThroughput.get() >= this.THRESHOLD || currentOperations.get() >=
this.THRESHOLD_COUNT;
+        if (currentThroughput.get() >= THRESHOLD)
+        {
+            logger.info("Memtable for CF {} has reached memtable_throughput_in_mb {}, enqueueing
flush",
+                        cfs.getColumnFamilyName(), THRESHOLD);
+            return true;
+        }
+        if (currentOperations.get() >= THRESHOLD_COUNT)
+        {
+            logger.info("Memtable for CF {} has reached memtable_operations_in_millions {},
enqueueing flush",
+                        cfs.getColumnFamilyName(), THRESHOLD_COUNT);
+            return true;
+        }
+        // default case, threshold is not violated.
+        return false;
     }
 
     boolean isFrozen()



Mime
View raw message