cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r771340 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra/db: BinaryMemtable.java Memtable.java
Date Mon, 04 May 2009 15:59:16 GMT
Author: jbellis
Date: Mon May  4 15:59:16 2009
New Revision: 771340

URL: http://svn.apache.org/viewvc?rev=771340&view=rev
Log:
use getTempFileName / closeRename to avoid problems w/ half-written sstables.
patch by jbellis; reviewed by Eric Evans for CASSANDRA-78

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/BinaryMemtable.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.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=771340&r1=771339&r2=771340&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 May
 4 15:59:16 2009
@@ -139,7 +139,7 @@
             return;
         ColumnFamilyStore cfStore = Table.open(table_).getColumnFamilyStore(cfName_);
         String directory = DatabaseDescriptor.getDataFileLocation();
-        String filename = cfStore.getNextFileName();
+        String filename = cfStore.getTempFileName();
 
         /*
          * Use the SSTable to write the contents of the TreeMap
@@ -160,7 +160,7 @@
                 bf.add(key);
             }
         }
-        ssTable.close(bf);
+        ssTable.closeRename(bf);
         cfStore.storeLocation( ssTable.getDataFileLocation(), bf );
         columnFamilies_.clear();       
     }

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=771340&r1=771339&r2=771340&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 May  4 15:59:16
2009
@@ -378,7 +378,7 @@
         }
 
         String directory = DatabaseDescriptor.getDataFileLocation();
-        String filename = cfStore.getNextFileName();
+        String filename = cfStore.getTempFileName();
         SSTable ssTable = new SSTable(directory, filename, StorageService.getPartitioner());
 
         // sort keys in the order they would be in when decorated
@@ -408,7 +408,7 @@
                 bf.add(key);
             }
         }
-        ssTable.close(bf);
+        ssTable.closeRename(bf);
         cfStore.onMemtableFlush(cLogCtx);
         cfStore.storeLocation( ssTable.getDataFileLocation(), bf );
         buffer.close();



Mime
View raw message