From 69e161cf64fecfefbe38ab011bd6e1a8a812267e Mon Sep 17 00:00:00 2001 From: tedyu Date: Tue, 2 Jan 2018 06:27:41 -0800 Subject: [PATCH] HBASE-19676 CleanerChore logging improvements (BELUGA BEHR) --- .../hadoop/hbase/master/cleaner/CleanerChore.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java index 15d00051ba4..944db106703 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java @@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory; public abstract class CleanerChore extends ScheduledChore implements ConfigurationObserver { - private static final Logger LOG = LoggerFactory.getLogger(CleanerChore.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(CleanerChore.class); private static final int AVAIL_PROCESSORS = Runtime.getRuntime().availableProcessors(); /** @@ -110,7 +110,7 @@ public abstract class CleanerChore extends Schedu chorePoolSize = chorePoolSize == 0 ? calculatePoolSize(DEFAULT_CHORE_POOL_SIZE) : chorePoolSize; this.chorePool = new ForkJoinPool(chorePoolSize); - LOG.info("Cleaner pool size is " + chorePoolSize); + LOG.info("Cleaner pool size is {}", chorePoolSize); } } @@ -125,7 +125,7 @@ public abstract class CleanerChore extends Schedu // but upmost to the number of available processors. int size = Math.min(Integer.valueOf(poolSize), AVAIL_PROCESSORS); if (size == AVAIL_PROCESSORS) { - LOG.warn("Use full core processors to scan dir, size={}" + size); + LOG.warn("Use full core processors to scan dir, size={}", size); } return size; } else if (poolSize.matches("0.[0-9]+|1.0")) { @@ -157,7 +157,7 @@ public abstract class CleanerChore extends Schedu for (String className : logCleaners) { T logCleaner = newFileCleaner(className, conf); if (logCleaner != null) { - LOG.debug("Initialize cleaner=" + className); + LOG.debug("Initialize cleaner={}", className); this.cleanersChain.add(logCleaner); } } @@ -216,7 +216,7 @@ public abstract class CleanerChore extends Schedu if (runCleaner()) { LOG.debug("Cleaned old files/dirs under {} successfully", oldFileDir); } else { - LOG.warn("Failed to fully clean old files/dirs under " + oldFileDir + "."); + LOG.warn("Failed to fully clean old files/dirs under {}", oldFileDir); } // After each clean chore, checks if receives reconfigure notification while cleaning if (reconfig.compareAndSet(true, false)) { @@ -268,7 +268,7 @@ public abstract class CleanerChore extends Schedu directorySpaces.put(f, space); return space; } catch (IOException e) { - LOG.trace("Failed to get space consumed by path={}", f.getPath(), e); + LOG.trace("Failed to get space consumed by path={}", f, e); return -1; } }