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 <uagashe@cloudera.com>
Signed-off-by: Sean Busbey <busbey@apache.org>
This commit is contained in:
Ashish Singhi 2017-06-16 10:43:56 +05:30 committed by Sean Busbey
parent df06294915
commit af466bf722
1 changed files with 16 additions and 11 deletions

View File

@ -42,6 +42,7 @@ import com.google.common.annotations.VisibleForTesting;
@InterfaceAudience.Private
public class FSDataInputStreamWrapper implements Closeable {
private static final Log LOG = LogFactory.getLog(FSDataInputStreamWrapper.class);
private static final boolean isLogTraceEnabled = LOG.isTraceEnabled();
private final HFileSystem hfs;
private final Path path;
@ -274,10 +275,11 @@ public class FSDataInputStreamWrapper implements Closeable {
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;
@ -289,15 +291,18 @@ public class FSDataInputStreamWrapper implements Closeable {
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");
}
}
}
}