hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject svn commit: r1457370 - /hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/Compression.java
Date Sun, 17 Mar 2013 04:09:32 GMT
Author: tedyu
Date: Sun Mar 17 04:09:31 2013
New Revision: 1457370

URL: http://svn.apache.org/r1457370
Log:
HBASE-8125 HBASE-7435 breaks BuiltInGzipDecompressor on Hadoop < 1.0.x (Ted Yu)


Modified:
    hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/Compression.java

Modified: hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/Compression.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/Compression.java?rev=1457370&r1=1457369&r2=1457370&view=diff
==============================================================================
--- hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/Compression.java (original)
+++ hbase/branches/0.94/src/main/java/org/apache/hadoop/hbase/io/hfile/Compression.java Sun
Mar 17 04:09:31 2013
@@ -22,6 +22,7 @@ import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.lang.annotation.Annotation;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -33,7 +34,6 @@ import org.apache.hadoop.io.compress.Com
 import org.apache.hadoop.io.compress.CompressionOutputStream;
 import org.apache.hadoop.io.compress.Compressor;
 import org.apache.hadoop.io.compress.Decompressor;
-import org.apache.hadoop.io.compress.DoNotPool;
 import org.apache.hadoop.io.compress.GzipCodec;
 import org.apache.hadoop.io.compress.DefaultCodec;
 import org.apache.hadoop.util.ReflectionUtils;
@@ -349,8 +349,13 @@ public final class Compression {
     public void returnDecompressor(Decompressor decompressor) {
       if (decompressor != null) {
         CodecPool.returnDecompressor(decompressor);
-        if (decompressor.getClass().isAnnotationPresent(DoNotPool.class)) {
-          decompressor.end();
+        Annotation[] annotations = decompressor.getClass().getAnnotations();
+        if (annotations != null) {
+          for (Annotation annotation : annotations) {
+            if (annotation.getClass().getSimpleName().equals("DoNotPool")) {
+              decompressor.end();              
+            }
+          }
         }
       }
     }



Mime
View raw message