Return-Path: Delivered-To: apmail-incubator-cassandra-commits-archive@minotaur.apache.org Received: (qmail 3318 invoked from network); 23 Sep 2009 18:44:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Sep 2009 18:44:38 -0000 Received: (qmail 16742 invoked by uid 500); 23 Sep 2009 18:44:38 -0000 Delivered-To: apmail-incubator-cassandra-commits-archive@incubator.apache.org Received: (qmail 16732 invoked by uid 500); 23 Sep 2009 18:44:38 -0000 Mailing-List: contact cassandra-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-commits@incubator.apache.org Received: (qmail 16722 invoked by uid 99); 23 Sep 2009 18:44:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 18:44:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 18:44:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9F7CC23888E2; Wed, 23 Sep 2009 18:44:16 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: cassandra-commits@incubator.apache.org From: jbellis@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090923184416.9F7CC23888E2@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 @@ --> 256 + + 256 + 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