cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1005909 - in /cassandra/trunk: CHANGES.txt src/java/org/apache/cassandra/config/Config.java src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Date Fri, 08 Oct 2010 17:11:16 GMT
Author: jbellis
Date: Fri Oct  8 17:11:16 2010
New Revision: 1005909

URL: http://svn.apache.org/viewvc?rev=1005909&view=rev
Log:
log auto-guessed memtable thresholds
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-1595

Modified:
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
    cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1005909&r1=1005908&r2=1005909&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Fri Oct  8 17:11:16 2010
@@ -21,6 +21,7 @@ dev
  * add StorageService.getDrainProgress (CASSANDRA-1588)
  * Disallow bootstrap to an in-use token (CASSANDRA-1561)
  * Allow dynamic secondary index creation and destruction (CASSANDRA-1532)
+ * log auto-guessed memtable thresholds (CASSANDRA-1595)
 
 
 0.7-beta2

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/Config.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/Config.java?rev=1005909&r1=1005908&r2=1005909&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/Config.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/Config.java Fri Oct  8 17:11:16 2010
@@ -76,9 +76,9 @@ public class Config
     /* Number of minutes to keep a memtable in memory */
     public Integer memtable_flush_after_mins = 60 * 60 * 1000;
     /* Size of the memtable in memory before it is dumped */
-    public Integer memtable_throughput_in_mb = (int) (Runtime.getRuntime().maxMemory() /
1048576 / 8);
+    public Integer memtable_throughput_in_mb;
     /* Number of objects in millions in the memtable before it is dumped */
-    public Double memtable_operations_in_millions = memtable_throughput_in_mb / 64.0 * 0.3;
+    public Double memtable_operations_in_millions;
     
     /* if the size of columns or super-columns are more than this, indexing will kick in
*/
     public Integer column_index_size_in_kb = 64;

Modified: cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=1005909&r1=1005908&r2=1005909&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java Fri Oct 
8 17:11:16 2010
@@ -142,6 +142,17 @@ public class    DatabaseDescriptor
                 throw new ConfigurationException("Missing required directive CommitLogSync");
             }
 
+            if (conf.memtable_throughput_in_mb == null)
+            {
+                conf.memtable_throughput_in_mb = (int) (Runtime.getRuntime().maxMemory()
/ (1048576 * 8));
+                logger.info("memtable_throughput_in_mb not configured, using " + conf.memtable_throughput_in_mb);
+            }
+            if (conf.memtable_operations_in_millions == null)
+            {
+                conf.memtable_operations_in_millions = 0.3 * conf.memtable_throughput_in_mb
/ 64.0;
+                logger.info("memtable_operations_in_millions not configured, using " + conf.memtable_operations_in_millions);
+            }
+
             if (conf.commitlog_sync == Config.CommitLogSync.batch)
             {
                 if (conf.commitlog_sync_batch_window_in_ms == null)



Mime
View raw message