HBASE-1460 Concurrent LRU Block Cache
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@788910 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
503b6f2838
commit
03e786b0a8
|
@ -477,17 +477,18 @@ public class LruBlockCache implements BlockCache, HeapSize {
|
|||
return this.stats.getEvictedCount();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Eviction thread. Sits in waiting state until an eviction is triggered
|
||||
* when the cache size grows above the acceptable level.<p>
|
||||
*
|
||||
* Thread is triggered into action by {@link LruBlockCache#runEviction()}
|
||||
*/
|
||||
private static class EvictionThread extends Thread {
|
||||
|
||||
private WeakReference<LruBlockCache> cache;
|
||||
|
||||
public EvictionThread(LruBlockCache cache) {
|
||||
super("LruBlockCache.EvictionThread");
|
||||
setDaemon(true);
|
||||
this.cache = new WeakReference<LruBlockCache>(cache);
|
||||
}
|
||||
|
||||
|
@ -511,12 +512,15 @@ public class LruBlockCache implements BlockCache, HeapSize {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Statistics thread. Periodically prints the cache statistics to the log.
|
||||
*/
|
||||
private static class StatisticsThread extends Thread {
|
||||
LruBlockCache lru;
|
||||
|
||||
public StatisticsThread(LruBlockCache lru) {
|
||||
super("LruBlockCache.StatisticsThread");
|
||||
setDaemon(true);
|
||||
this.lru = lru;
|
||||
}
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue