HBASE-18212 reduce log level for unbuffer warning.

In Standalone mode with local filesystem HBase logs Warning message:Failed to 
invoke 'unbuffer' method in class org.apache.hadoop.fs.FSDataInputStream

Signed-off-by: Umesh Agashe <[email protected]>
Signed-off-by: Sean Busbey <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/b5a08a89
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/b5a08a89
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/b5a08a89

Branch: refs/heads/branch-1.1
Commit: b5a08a89dc9e81d5ad60e46c1c7259afaba6e4ad
Parents: 0936f1f
Author: Ashish Singhi <[email protected]>
Authored: Fri Jun 16 10:43:56 2017 +0530
Committer: Sean Busbey <[email protected]>
Committed: Tue Jun 20 11:10:26 2017 -0500

----------------------------------------------------------------------
 .../hbase/io/FSDataInputStreamWrapper.java      | 27 ++++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/b5a08a89/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
----------------------------------------------------------------------
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
index ae98fd3..257a125 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/FSDataInputStreamWrapper.java
@@ -39,6 +39,7 @@ import com.google.common.annotations.VisibleForTesting;
  */
 public class FSDataInputStreamWrapper {
   private static final Log LOG = 
LogFactory.getLog(FSDataInputStreamWrapper.class);
+  private static final boolean isLogTraceEnabled = LOG.isTraceEnabled();
 
   private final HFileSystem hfs;
   private final Path path;
@@ -247,10 +248,11 @@ public class FSDataInputStreamWrapper {
             try {
               this.unbuffer = streamClass.getDeclaredMethod("unbuffer");
             } catch (NoSuchMethodException | SecurityException e) {
-              LOG.warn("Failed to find 'unbuffer' method in class " + 
streamClass
-                  + " . So there may be a TCP socket connection "
-                  + "left open in CLOSE_WAIT state.",
-                e);
+              if (isLogTraceEnabled) {
+                LOG.trace("Failed to find 'unbuffer' method in class " + 
streamClass
+                    + " . So there may be a TCP socket connection "
+                    + "left open in CLOSE_WAIT state.", e);
+              }
               return;
             }
             this.instanceOfCanUnbuffer = true;
@@ -262,15 +264,18 @@ public class FSDataInputStreamWrapper {
         try {
           this.unbuffer.invoke(wrappedStream);
         } catch (IllegalAccessException | IllegalArgumentException | 
InvocationTargetException e) {
-          LOG.warn("Failed to invoke 'unbuffer' method in class " + streamClass
-              + " . So there may be a TCP socket connection left open in 
CLOSE_WAIT state.",
-            e);
+          if (isLogTraceEnabled) {
+            LOG.trace("Failed to invoke 'unbuffer' method in class " + 
streamClass
+                + " . So there may be a TCP socket connection left open in 
CLOSE_WAIT state.", e);
+          }
         }
       } else {
-        LOG.warn("Failed to find 'unbuffer' method in class " + streamClass
-            + " . So there may be a TCP socket connection "
-            + "left open in CLOSE_WAIT state. For more details check "
-            + "https://issues.apache.org/jira/browse/HBASE-9393";);
+        if (isLogTraceEnabled) {
+          LOG.trace("Failed to find 'unbuffer' method in class " + streamClass
+              + " . So there may be a TCP socket connection "
+              + "left open in CLOSE_WAIT state. For more details check "
+              + "https://issues.apache.org/jira/browse/HBASE-9393";);
+        }
       }
     }
   }

Reply via email to