Index: src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java (revision 1177180) +++ src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java (working copy) @@ -21,7 +21,6 @@ import java.nio.ByteBuffer; import java.util.List; -import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicLong; import org.apache.commons.logging.Log; @@ -37,8 +36,10 @@ import org.apache.hadoop.hbase.util.ClassSize; import org.apache.hadoop.util.StringUtils; -import com.google.common.collect.MapEvictionListener; -import com.google.common.collect.MapMaker; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.RemovalListener; +import com.google.common.cache.RemovalNotification; /** * SingleSizeCache is a slab allocated cache that caches elements up to a single @@ -53,7 +54,7 @@ **/ public class SingleSizeCache implements BlockCache, HeapSize { private final Slab backingStore; - private final ConcurrentMap backingMap; + private final Cache backingMap; private final int numBlocks; private final int blockSize; private final CacheStats stats; @@ -89,17 +90,19 @@ // This evictionListener is called whenever the cache automatically evicts // something. - MapEvictionListener listener = new MapEvictionListener() { + RemovalListener listener = new RemovalListener() { @Override - public void onEviction(String key, CacheablePair value) { + public void onRemoval(RemovalNotification notification) { + String key = notification.getKey(); + CacheablePair value = notification.getValue(); timeSinceLastAccess.set(System.nanoTime() - value.recentlyAccessed.get()); doEviction(key, value); } }; - backingMap = new MapMaker().maximumSize(numBlocks - 1) - .evictionListener(listener).makeMap(); + backingMap = CacheBuilder.newBuilder().weakKeys().maximumSize(numBlocks - 1) + .removalListener(listener).makeMap(); } Index: pom.xml =================================================================== --- pom.xml (revision 1177180) +++ pom.xml (working copy) @@ -699,7 +699,7 @@ 2.5 1.1.1 2.1 - r09 + 10.0 1.5.5 5.5.23 2.1