cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r812161 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/db: BinaryMemtable.java ColumnFamilyStore.java Memtable.java Table.java
Date Mon, 07 Sep 2009 14:45:04 GMT
Author: jbellis
Date: Mon Sep  7 14:45:04 2009
New Revision: 812161

URL: http://svn.apache.org/viewvc?rev=812161&view=rev
Log:
CASSANDRA-414 combine addToList and storeLocation; rename to addSSTable

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

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=812161&r1=812160&r2=812161&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
 7 14:45:04 2009
@@ -175,7 +175,7 @@
                 writer.append(key, bytes);
             }
         }
-        cfStore.storeLocation(writer.closeAndOpenReader());
+        cfStore.addSSTable(writer.closeAndOpenReader());
         columnFamilies_.clear();       
     }
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java?rev=812161&r1=812160&r2=812161&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/ColumnFamilyStore.java Mon
Sep  7 14:45:04 2009
@@ -241,24 +241,7 @@
         sb.append(newLineSeparator);
         return sb.toString();
     }
-
-    /*
-     * This is called after bootstrap to add the files
-     * to the list of files maintained.
-    */
-    void addToList(SSTableReader file)
-    {
-        sstableLock_.writeLock().lock();
-        try
-        {
-            ssTables_.put(file.getFilename(), file);
-        }
-        finally
-        {
-            sstableLock_.writeLock().unlock();
-        }
-    }
-
+    
     /*
      * This method forces a compaction of the SSTables on disk. We wait
      * for the process to complete by waiting on a future pointer.
@@ -585,7 +568,8 @@
     }
 
     /*
-     * Called after the Memtable flushes its in-memory data. This information is
+     * Called after the Memtable flushes its in-memory data, or we add a file
+     * via bootstrap. This information is
      * cached in the ColumnFamilyStore. This is useful for reads because the
      * ColumnFamilyStore first looks in the in-memory store and the into the
      * disk to find the key. If invoked during recoveryMode the
@@ -594,7 +578,7 @@
      * param @ filename - filename just flushed to disk
      * param @ bf - bloom filter which indicates the keys that are in this file.
     */
-    void storeLocation(SSTableReader sstable)
+    void addSSTable(SSTableReader sstable)
     {
         int ssTableCount;
         sstableLock_.writeLock().lock();

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=812161&r1=812160&r2=812161&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Mon Sep  7 14:45:04
2009
@@ -214,7 +214,7 @@
         }
         SSTableReader ssTable = writer.closeAndOpenReader();
         cfStore.onMemtableFlush(cLogCtx);
-        cfStore.storeLocation(ssTable);
+        cfStore.addSSTable(ssTable);
         buffer.close();
         isFlushed_ = true;
         logger_.info("Completed flushing " + this);

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=812161&r1=812160&r2=812161&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Mon Sep  7 14:45:04
2009
@@ -23,18 +23,12 @@
 import java.io.File;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
-import java.util.concurrent.ExecutionException;
-
-import org.apache.commons.collections.IteratorUtils;
-import org.apache.commons.collections.Predicate;
-import org.apache.commons.lang.ArrayUtils;
 
 import org.apache.cassandra.config.DatabaseDescriptor;
 import org.apache.cassandra.dht.BootstrapInitiateMessage;
 import org.apache.cassandra.dht.Range;
 import org.apache.cassandra.io.DataInputBuffer;
 import org.apache.cassandra.io.SSTableReader;
-import org.apache.cassandra.io.FileStruct;
 import org.apache.cassandra.io.SSTableWriter;
 import org.apache.cassandra.net.EndPoint;
 import org.apache.cassandra.net.IVerbHandler;
@@ -185,7 +179,7 @@
                     sstable = SSTableWriter.renameAndOpen(streamContext.getTargetFile());
                     
                     //TODO add a sanity check that this sstable has all its parts and is
ok
-                    Table.open(tableName).getColumnFamilyStore(temp[0]).addToList(sstable);
+                    Table.open(tableName).getColumnFamilyStore(temp[0]).addSSTable(sstable);
                     logger_.info("Bootstrap added " + sstable.getFilename());
                 }
                 catch (IOException e)



Mime
View raw message