cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r818194 - in /incubator/cassandra/trunk: conf/storage-conf.xml src/java/org/apache/cassandra/db/BinaryMemtable.java
Date Wed, 23 Sep 2009 18:44:16 GMT
Author: jbellis
Date: Wed Sep 23 18:44:16 2009
New Revision: 818194

URL: http://svn.apache.org/viewvc?rev=818194&view=rev
Log:
add back BinaryMemtable tuneable, but remove the hardcoded 50k limit

Modified:
    incubator/cassandra/trunk/conf/storage-conf.xml
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryMemtable.java

Modified: incubator/cassandra/trunk/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/conf/storage-conf.xml?rev=818194&r1=818193&r2=818194&view=diff
==============================================================================
--- incubator/cassandra/trunk/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/conf/storage-conf.xml Wed Sep 23 18:44:16 2009
@@ -304,4 +304,9 @@
   -->
   <BinaryMemtableSizeInMB>256</BinaryMemtableSizeInMB>
 
+  <!--
+   ~ The threshold size in megabytes the binary memtable must grow to, before it's submitted
for flushing to disk.
+  -->
+  <BinaryMemtableSizeInMB>256</BinaryMemtableSizeInMB>
+
 </Storage>

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryMemtable.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryMemtable.java?rev=818194&r1=818193&r2=818194&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryMemtable.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryMemtable.java Wed Sep
23 18:44:16 2009
@@ -39,9 +39,8 @@
 
 public class BinaryMemtable implements IFlushable
 {
-    private static Logger logger_ = Logger.getLogger( Memtable.class );
-    private int threshold_ = DatabaseDescriptor.getMemtableSize()*1024*1024;
-    private int thresholdCount_ = (int)(DatabaseDescriptor.getMemtableObjectCount()*1024*1024);
+    private static Logger logger_ = Logger.getLogger(BinaryMemtable.class);
+    private int threshold_ = DatabaseDescriptor.getBMTThreshold() * 1024 * 1024;
     private AtomicInteger currentSize_ = new AtomicInteger(0);
 
     /* Table and ColumnFamily name are used to determine the ColumnFamilyStore */
@@ -74,13 +73,7 @@
 
     boolean isThresholdViolated()
     {
-        if (currentSize_.get() >= threshold_ || columnFamilies_.size() > thresholdCount_)
-        {
-            if (logger_.isDebugEnabled())
-              logger_.debug("CURRENT SIZE:" + currentSize_.get());
-        	return true;
-        }
-        return false;
+        return currentSize_.get() >= threshold_;
     }
 
     String getColumnFamily()
@@ -95,7 +88,7 @@
     */
     void put(String key, byte[] buffer) throws IOException
     {
-        if (isThresholdViolated() )
+        if (isThresholdViolated())
         {
             lock_.lock();
             try



Mime
View raw message