busbey commented on a change in pull request #913: HBASE-23381: Improve Logging
in HBase Commons Package
URL: https://github.com/apache/hbase/pull/913#discussion_r355210657
##########
File path:
hbase-common/src/main/java/org/apache/hadoop/hbase/util/CommonFSUtils.java
##########
@@ -593,56 +585,52 @@ private static void invokeSetStoragePolicy(final
FileSystem fs, final Path path,
"to the user@hbase mailing list. Please be sure to include a link to
your configs, and " +
"logs that include this message and period of time before it. Logs
around service " +
"start up will probably be useful as well.";
+
+ LOG.debug(msg, e);
if (!warningMap.containsKey(fs)) {
warningMap.put(fs, true);
LOG.warn(msg, e);
- } else if (LOG.isDebugEnabled()) {
- LOG.debug(msg, e);
}
m = null; // could happen on setAccessible() or getDeclaredMethod()
}
if (m != null) {
try {
m.invoke(fs, path, storagePolicy);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Set storagePolicy=" + storagePolicy + " for path=" +
path);
- }
+ LOG.debug("Set storagePolicy={} for path={}", storagePolicy, path);
} catch (Exception e) {
toThrow = e;
// This swallows FNFE, should we be throwing it? seems more likely to
indicate dev
// misuse than a runtime problem with HDFS.
+ LOG.debug("Unable to set storagePolicy={} for path={}", storagePolicy,
path, e);
Review comment:
This should be in an else block to the if below. We don't want to log both a
debug and a warn statement for the same event.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services