accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [14/19] accumulo git commit: ACCUMULO-4036 Demote verbose block cache logging, switch to slf4j loggers.
Date Thu, 31 Dec 2015 06:18:01 GMT
ACCUMULO-4036 Demote verbose block cache logging, switch to slf4j loggers.


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/e1e41005
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/e1e41005
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/e1e41005

Branch: refs/heads/master
Commit: e1e4100583bf18d28c15ad9c2cc8b391d992ec99
Parents: 50b29af
Author: Josh Elser <elserj@apache.org>
Authored: Wed Dec 30 22:42:52 2015 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Wed Dec 30 22:42:52 2015 -0500

----------------------------------------------------------------------
 .../file/blockfile/cache/LruBlockCache.java     | 22 +++++++++-----------
 1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/e1e41005/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
index d1b9f34..a6af6e9 100644
--- a/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
+++ b/core/src/main/java/org/apache/accumulo/core/file/blockfile/cache/LruBlockCache.java
@@ -27,8 +27,8 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantLock;
 
 import org.apache.accumulo.core.util.NamingThreadFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A block cache implementation that is memory-aware using {@link HeapSize}, memory-bound
using an LRU eviction algorithm, and concurrent: backed by a
@@ -62,7 +62,7 @@ import org.apache.commons.logging.LogFactory;
  */
 public class LruBlockCache implements BlockCache, HeapSize {
 
-  static final Log LOG = LogFactory.getLog(LruBlockCache.class);
+  private static final Logger log = LoggerFactory.getLogger(LruBlockCache.class);
 
   /** Default Configuration Parameters */
 
@@ -331,7 +331,7 @@ public class LruBlockCache implements BlockCache, HeapSize {
 
       long bytesToFree = size.get() - minSize();
 
-      LOG.debug("Block cache LRU eviction started.  Attempting to free " + bytesToFree +
" bytes");
+      log.trace("Block cache LRU eviction started.  Attempting to free {} bytes", bytesToFree);
 
       if (bytesToFree <= 0)
         return;
@@ -382,9 +382,8 @@ public class LruBlockCache implements BlockCache, HeapSize {
       float multiMB = ((float) bucketMulti.totalSize()) / ((float) (1024 * 1024));
       float memoryMB = ((float) bucketMemory.totalSize()) / ((float) (1024 * 1024));
 
-      LOG.debug("Block cache LRU eviction completed. " + "Freed " + bytesFreed + " bytes.
 " + "Priority Sizes: " + "Single=" + singleMB + "MB ("
-          + bucketSingle.totalSize() + "), " + "Multi=" + multiMB + "MB (" + bucketMulti.totalSize()
+ ")," + "Memory=" + memoryMB + "MB ("
-          + bucketMemory.totalSize() + ")");
+      log.trace("Block cache LRU eviction completed. Freed {} bytes. Priority Sizes: Single={}MB
({}), Multi={}MB ({}), Memory={}MB ({})", bytesFreed,
+          singleMB, bucketSingle.totalSize(), multiMB, bucketMulti.totalSize(), memoryMB,
bucketMemory.totalSize());
 
     } finally {
       stats.evict();
@@ -565,11 +564,10 @@ public class LruBlockCache implements BlockCache, HeapSize {
     float sizeMB = ((float) totalSize) / ((float) (1024 * 1024));
     float freeMB = ((float) freeSize) / ((float) (1024 * 1024));
     float maxMB = ((float) maxSize) / ((float) (1024 * 1024));
-    LruBlockCache.LOG.debug("Cache Stats: Sizes: " + "Total=" + sizeMB + "MB (" + totalSize
+ "), " + "Free=" + freeMB + "MB (" + freeSize + "), " + "Max="
-        + maxMB + "MB (" + maxSize + ")" + ", Counts: " + "Blocks=" + size() + ", " + "Access="
+ stats.getRequestCount() + ", " + "Hit=" + stats.getHitCount()
-        + ", " + "Miss=" + stats.getMissCount() + ", " + "Evictions=" + stats.getEvictionCount()
+ ", " + "Evicted=" + stats.getEvictedCount() + ", Ratios: "
-        + "Hit Ratio=" + stats.getHitRatio() * 100 + "%, " + "Miss Ratio=" + stats.getMissRatio()
* 100 + "%, " + "Evicted/Run=" + stats.evictedPerEviction()
-        + ", " + "Duplicate Reads=" + stats.getDuplicateReads());
+    log.debug("Cache Stats: Sizes: Total={}MB ({}), Free={}MB ({}), Max={}MB ({}), Counts:
Blocks={}, Access={}, Hit={}, Miss={}, Evictions={}, Evicted={},"
+        + "Ratios: Hit Ratio={}%, Miss Ratio={}%, Evicted/Run={}, Duplicate Reads={}", sizeMB,
totalSize, freeMB, freeSize, maxMB, maxSize, size(),
+        stats.getRequestCount(), stats.getHitCount(), stats.getMissCount(), stats.getEvictionCount(),
stats.getEvictedCount(), stats.getHitRatio() * 100,
+        stats.getMissRatio() * 100, stats.evictedPerEviction(), stats.getDuplicateReads());
   }
 
   /**


Mime
View raw message