You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2009/09/21 16:20:01 UTC

svn commit: r817265 - in /incubator/cassandra/trunk: conf/storage-conf.xml src/java/org/apache/cassandra/config/DatabaseDescriptor.java src/java/org/apache/cassandra/db/BinaryMemtable.java

Author: jbellis
Date: Mon Sep 21 14:20:00 2009
New Revision: 817265

URL: http://svn.apache.org/viewvc?rev=817265&view=rev
Log:
Consolidate BMT threshold and object count sizes into getMemtableSize() and getMemtableObjectCount().  patch by Chris Goffinet; reviewed by jbellis for CASSANDRA-433

Modified:
    incubator/cassandra/trunk/conf/storage-conf.xml
    incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    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=817265&r1=817264&r2=817265&view=diff
==============================================================================
--- incubator/cassandra/trunk/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/conf/storage-conf.xml Mon Sep 21 14:20:00 2009
@@ -307,9 +307,4 @@
   <FlushMinThreads>1</FlushMinThreads>
   <FlushMaxThreads>1</FlushMaxThreads>
 
-  <!--
-   ~ 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/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=817265&r1=817264&r2=817265&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Mon Sep 21 14:20:00 2009
@@ -76,7 +76,6 @@
     private static Set<String> applicationColumnFamilies_ = new HashSet<String>();
     private static int flushMinThreads_ = 1;
     private static int flushMaxThreads_ = 1;
-    private static int bmtThreshold_ = 256;
 
     // Default descriptive names for introspection. The user can override
     // these choices in the config file. These are not case sensitive.
@@ -285,12 +284,6 @@
                 flushMaxThreads_ = Integer.parseInt(rawflushMaxThreads);
             }
 
-            String bmtThreshold = xmlUtils.getNodeValue("/Storage/BinaryMemtableSizeInMB");
-            if (bmtThreshold != null)
-            {
-                bmtThreshold_ = Integer.parseInt(bmtThreshold);
-            }
-
             /* TCP port on which the storage system listens */
             String port = xmlUtils.getNodeValue("/Storage/StoragePort");
             if ( port != null )
@@ -1012,8 +1005,4 @@
         return flushMaxThreads_;
     }
 
-    public static int getBMTThreshold()
-    {
-        return bmtThreshold_;
-    }
 }

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=817265&r1=817264&r2=817265&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 Mon Sep 21 14:20:00 2009
@@ -39,7 +39,8 @@
 public class BinaryMemtable
 {
     private static Logger logger_ = Logger.getLogger( Memtable.class );
-    private int threshold_ = DatabaseDescriptor.getBMTThreshold()*1024*1024;
+    private int threshold_ = DatabaseDescriptor.getMemtableSize()*1024*1024;
+    private int thresholdCount_ = (int)(DatabaseDescriptor.getMemtableObjectCount()*1024*1024);
     private AtomicInteger currentSize_ = new AtomicInteger(0);
 
     /* Table and ColumnFamily name are used to determine the ColumnFamilyStore */
@@ -72,7 +73,7 @@
 
     boolean isThresholdViolated()
     {
-        if (currentSize_.get() >= threshold_ || columnFamilies_.size() > 50000)
+        if (currentSize_.get() >= threshold_ || columnFamilies_.size() > thresholdCount_)
         {
             if (logger_.isDebugEnabled())
               logger_.debug("CURRENT SIZE:" + currentSize_.get());