From 1ae03f81b98b1530acf1ddba8a8203c2cf771631 Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Mon, 7 Feb 2011 21:14:54 +0000 Subject: [PATCH] HBASE-3508. LruBlockCache statistics thread should have a name git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1068140 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../org/apache/hadoop/hbase/io/hfile/LruBlockCache.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index ac4f08923f7..6610f2d1d97 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -93,6 +93,7 @@ Release 0.90.1 - Unreleased IMPROVEMENTS HBASE-3470 Check that hbase-default.xml is loaded from within jar + HBASE-3508 LruBlockCache statistics thread should have a name Release 0.90.0 - January 19th, 2011 INCOMPATIBLE CHANGES diff --git a/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java b/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java index 009ee3ca661..94879672360 100644 --- a/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java +++ b/src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java @@ -37,6 +37,8 @@ import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.util.StringUtils; +import com.google.common.util.concurrent.ThreadFactoryBuilder; + /** * A block cache implementation that is memory-aware using {@link HeapSize}, * memory-bound using an LRU eviction algorithm, and concurrent: backed by a @@ -111,7 +113,10 @@ public class LruBlockCache implements BlockCache, HeapSize { /** Statistics thread schedule pool (for heavy debugging, could remove) */ private final ScheduledExecutorService scheduleThreadPool = - Executors.newScheduledThreadPool(1); + Executors.newScheduledThreadPool(1, + new ThreadFactoryBuilder() + .setNameFormat("LRU Statistics #%d") + .build()); /** Current size of cache */ private final AtomicLong size;