hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1426524 - /hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java
Date Fri, 28 Dec 2012 14:41:56 GMT
Author: hashutosh
Date: Fri Dec 28 14:41:55 2012
New Revision: 1426524

URL: http://svn.apache.org/viewvc?rev=1426524&view=rev
Log:
HIVE-3809 : Concurrency issue in RCFile: multiple threads can use the same decompressor (Mikhail
Bautin via Ashutosh Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java?rev=1426524&r1=1426523&r2=1426524&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/io/RCFile.java Fri Dec 28 14:41:55 2012
@@ -548,7 +548,11 @@ public class RCFile {
       }
       if (codec != null) {
         IOUtils.closeStream(decompressBuffer);
-        CodecPool.returnDecompressor(valDecompressor);
+        if (valDecompressor != null) {
+          // Make sure we only return valDecompressor once.
+          CodecPool.returnDecompressor(valDecompressor);
+          valDecompressor = null;
+        }
       }
     }
 
@@ -1757,7 +1761,11 @@ public class RCFile {
       currentValue.close();
       if (decompress) {
         IOUtils.closeStream(keyDecompressedData);
-        CodecPool.returnDecompressor(keyDecompressor);
+        if (keyDecompressor != null) {
+          // Make sure we only return keyDecompressor once.
+          CodecPool.returnDecompressor(keyDecompressor);
+          keyDecompressor = null;
+        }
       }
     }
 



Mime
View raw message