avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r1079055 - in /avro/trunk: CHANGES.txt lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java lang/java/avro/src/main/java/org/apache/avro/file/SeekableInput.java
Date Tue, 08 Mar 2011 00:55:57 GMT
Author: cutting
Date: Tue Mar  8 00:55:57 2011
New Revision: 1079055

URL: http://svn.apache.org/viewvc?rev=1079055&view=rev
Log:
AVRO-775. Java: Fix a file handle leak in DataFileReader.

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java
    avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/SeekableInput.java

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1079055&r1=1079054&r2=1079055&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Tue Mar  8 00:55:57 2011
@@ -298,6 +298,8 @@ Avro 1.5.0 (4 March 2011)
     AVRO-755. Java: Fix SpecificResponder to correctly handle message
     parameter lists that differ between client and server.  (cutting)
 
+    AVRO-775. Java: Fix a file handle leak in DataFileReader. (cutting)
+
 Avro 1.4.1 (13 October 2010)
 
   NEW FEATURES

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java?rev=1079055&r1=1079054&r2=1079055&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java Tue Mar
 8 00:55:57 2011
@@ -230,6 +230,12 @@ public class DataFileReader<D>
   }
 
     @Override
+    public void close() throws IOException {
+        in.close();
+        super.close();
+    }
+
+    @Override
     public int available() throws IOException {
       long remaining = (in.length() - in.tell());
       return (remaining > Integer.MAX_VALUE) ? Integer.MAX_VALUE

Modified: avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/SeekableInput.java
URL: http://svn.apache.org/viewvc/avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/SeekableInput.java?rev=1079055&r1=1079054&r2=1079055&view=diff
==============================================================================
--- avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/SeekableInput.java (original)
+++ avro/trunk/lang/java/avro/src/main/java/org/apache/avro/file/SeekableInput.java Tue Mar
 8 00:55:57 2011
@@ -18,9 +18,10 @@
 package org.apache.avro.file;
 
 import java.io.IOException;
+import java.io.Closeable;
 
 /** An InputStream that supports seek and tell. */
-public interface SeekableInput {
+public interface SeekableInput extends Closeable {
 
   /** Set the position for the next {@link java.io.InputStream#read(byte[],int,int) read()}.
*/
   void seek(long p) throws IOException;



Mime
View raw message