You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-commits@hadoop.apache.org by to...@apache.org on 2011/05/18 20:58:55 UTC

svn commit: r1124383 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/IFile.java

Author: tomwhite
Date: Wed May 18 18:58:55 2011
New Revision: 1124383

URL: http://svn.apache.org/viewvc?rev=1124383&view=rev
Log:
MAPREDUCE-2258. IFile reader closes stream and compressor in wrong order. Contributed by Todd Lipcon.

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IFile.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1124383&r1=1124382&r2=1124383&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Wed May 18 18:58:55 2011
@@ -193,6 +193,9 @@ Trunk (unreleased changes)
     MAPREDUCE-2467. HDFS-1052 changes break the raid contrib module in 
     MapReduce. (suresh srinivas via mahadev)
 
+    MAPREDUCE-2258. IFile reader closes stream and compressor in wrong order.
+    (todd via tomwhite)
+
 Release 0.22.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IFile.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IFile.java?rev=1124383&r1=1124382&r2=1124383&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IFile.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/IFile.java Wed May 18 18:58:55 2011
@@ -453,13 +453,6 @@ public class IFile {
     }
     
     public void close() throws IOException {
-      // Return the decompressor
-      if (decompressor != null) {
-        decompressor.reset();
-        CodecPool.returnDecompressor(decompressor);
-        decompressor = null;
-      }
-      
       // Close the underlying stream
       in.close();
       
@@ -469,6 +462,13 @@ public class IFile {
       if(readRecordsCounter != null) {
         readRecordsCounter.increment(numRecordsRead);
       }
+
+      // Return the decompressor
+      if (decompressor != null) {
+        decompressor.reset();
+        CodecPool.returnDecompressor(decompressor);
+        decompressor = null;
+      }
     }
     
     public void reset(int offset) {