cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1040782 - in /cassandra/branches/cassandra-0.7: CHANGES.txt src/java/org/apache/cassandra/io/sstable/SSTableWriter.java src/java/org/apache/cassandra/io/util/FileUtils.java
Date Tue, 30 Nov 2010 21:30:51 GMT
Author: jbellis
Date: Tue Nov 30 21:30:51 2010
New Revision: 1040782

URL: http://svn.apache.org/viewvc?rev=1040782&view=rev
Log:
close file handle used for post-flush truncate
patch by jbellis; reviewed by mdennis for CASSANDRA-1790

Modified:
    cassandra/branches/cassandra-0.7/CHANGES.txt
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileUtils.java

Modified: cassandra/branches/cassandra-0.7/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/CHANGES.txt?rev=1040782&r1=1040781&r2=1040782&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.7/CHANGES.txt Tue Nov 30 21:30:51 2010
@@ -20,6 +20,7 @@ dev
  * add ExpiringColumn support to sstable import/export (CASSANDRA-1754)
  * add flush for each append to periodic commitlog mode; added
    periodic_without_flush option to disable this (CASSANDRA-1780)
+ * close file handle used for post-flush truncate (CASSANDRA-1790)
 
 
 0.7.0-rc1

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java?rev=1040782&r1=1040781&r2=1040782&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/sstable/SSTableWriter.java
Tue Nov 30 21:30:51 2010
@@ -183,7 +183,6 @@ public class SSTableWriter extends SSTab
         // remove the 'tmp' marker from all components
         final Descriptor newdesc = rename(descriptor, components);
 
-
         // finalize in-memory state for the reader
         SegmentedFile ifile = iwriter.builder.complete(newdesc.filenameFor(SSTable.COMPONENT_INDEX));
         SegmentedFile dfile = dbuilder.complete(newdesc.filenameFor(SSTable.COMPONENT_DATA));

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileUtils.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileUtils.java?rev=1040782&r1=1040781&r2=1040782&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileUtils.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/io/util/FileUtils.java
Tue Nov 30 21:30:51 2010
@@ -75,7 +75,14 @@ public class FileUtils
         {
             throw new RuntimeException(e);
         }
-        file.getChannel().truncate(size);
+        try
+        {
+            file.getChannel().truncate(size);
+        }
+        finally
+        {
+            file.close();
+        }
     }
 
     public static class FileComparator implements Comparator<File>



Mime
View raw message