cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r987630 - in /cassandra/trunk: CHANGES.txt src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java
Date Fri, 20 Aug 2010 20:43:26 GMT
Author: jbellis
Date: Fri Aug 20 20:43:25 2010
New Revision: 987630

URL: http://svn.apache.org/viewvc?rev=987630&view=rev
Log:
fix FD leak in single-row slicepredicate queries.
patch by jbellis; reviewed by brandonwilliams for CASSANDRA-1416

Modified:
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java

Modified: cassandra/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=987630&r1=987629&r2=987630&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Fri Aug 20 20:43:25 2010
@@ -23,6 +23,7 @@ dev
    matches a '^\w+' regex. (CASSANDRA-1377)
  * use JNA, if present, to take snapshots (CASSANDRA-1371)
  * truncate hints if starting 0.7 for the first time (CASSANDRA-1414)
+ * fix FD leak in single-row slicepredicate queries (CASSANDRA-1416)
 
 
 0.7-beta1

Modified: cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java?rev=987630&r1=987629&r2=987630&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/db/columniterator/SSTableSliceIterator.java
Fri Aug 20 20:43:25 2010
@@ -62,7 +62,6 @@ public class SSTableSliceIterator implem
      */
     public SSTableSliceIterator(SSTableReader ssTable, FileDataInput file, DecoratedKey key,
byte[] startColumn, byte[] finishColumn, boolean reversed)
     {
-        this.file = file;
         this.decoratedKey = key;
 
         if (file == null)
@@ -70,7 +69,10 @@ public class SSTableSliceIterator implem
             closeFileWhenDone = true; //if we create it, we close it
             file = ssTable.getFileDataInput(decoratedKey, DatabaseDescriptor.getSlicedReadBufferSizeInKB()
* 1024);
             if (file == null)
+            {
+                this.file = null;
                 return;
+            }
             try
             {
                 DecoratedKey keyInDisk = SSTableReader.decodeKey(ssTable.getPartitioner(),
@@ -85,6 +87,7 @@ public class SSTableSliceIterator implem
                 throw new IOError(e);
             }
         }
+        this.file = file;
 
         reader = startColumn.length == 0 && !reversed
                  ? new SimpleSliceReader(ssTable, file, finishColumn)



Mime
View raw message