diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/store/LogExactlyOnce.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/store/LogExactlyOnce.java index 04cd5111e9..e32c0e424a 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/store/LogExactlyOnce.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/store/LogExactlyOnce.java @@ -49,4 +49,15 @@ public void error(String format, Object...args) { log.error(format, args); } } + + /** + * Log at DEBUG if nothing has been logged yet. + * @param format format string + * @param args arguments + */ + public void debug(String format, Object...args) { + if (!logged.getAndSet(true)) { + log.debug(format, args); + } + } }