diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java b/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java index c245f060487..1c9202ad1ae 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java @@ -454,26 +454,26 @@ public class HLog implements Syncable { */ private Method getGetNumCurrentReplicas(final FSDataOutputStream os) { Method m = null; - Exception exception = null; if (os != null) { + Class wrappedStreamClass = os.getWrappedStream() + .getClass(); try { - m = os.getWrappedStream().getClass(). - getDeclaredMethod("getNumCurrentReplicas", new Class []{}); + m = wrappedStreamClass.getDeclaredMethod("getNumCurrentReplicas", + new Class[] {}); m.setAccessible(true); } catch (NoSuchMethodException e) { - // Thrown if getNumCurrentReplicas() function isn't available - exception = e; + LOG.info("FileSystem's output stream doesn't support" + + " getNumCurrentReplicas; --HDFS-826 not available; fsOut=" + + wrappedStreamClass.getName()); } catch (SecurityException e) { - // Thrown if we can't get access to getNumCurrentReplicas() - exception = e; + LOG.info("Doesn't have access to getNumCurrentReplicas on " + + "FileSystems's output stream --HDFS-826 not available; fsOut=" + + wrappedStreamClass.getName(), e); m = null; // could happen on setAccessible() } } if (m != null) { LOG.info("Using getNumCurrentReplicas--HDFS-826"); - } else { - LOG.info("getNumCurrentReplicas--HDFS-826 not available; hdfs_out=" + - os, exception); } return m; }