cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r761452 - /incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java
Date Thu, 02 Apr 2009 22:29:15 GMT
Author: jbellis
Date: Thu Apr  2 22:29:14 2009
New Revision: 761452

URL: http://svn.apache.org/viewvc?rev=761452&view=rev
Log:
simplify 4 if's into 1

Modified:
    incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java

Modified: incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java?rev=761452&r1=761451&r2=761452&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/org/apache/cassandra/db/ColumnFamilyStore.java Thu Apr 
2 22:29:14 2009
@@ -634,7 +634,6 @@
     */
     void storeLocation(String filename, BloomFilter bf)
     {
-        boolean doCompaction = false;
         int ssTableSize = 0;
     	lock_.writeLock().lock();
         try
@@ -647,19 +646,9 @@
         {
         	lock_.writeLock().unlock();
         }
-        if (ssTableSize >= threshHold_ && !isCompacting_.get())
-        {
-            doCompaction = true;
-        }
 
-        if (isCompacting_.get())
-        {
-            if ( ssTableSize % threshHold_ == 0 )
-            {
-                doCompaction = true;
-            }
-        }
-        if ( doCompaction )
+        if ((ssTableSize >= threshHold_ && !isCompacting_.get())
+            || (isCompacting_.get() && ssTableSize % threshHold_ == 0))
         {
             logger_.debug("Submitting for  compaction ...");
             MinorCompactionManager.instance().submit(ColumnFamilyStore.this);



Mime
View raw message