diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java index de6aec7aa2f..f0177014f10 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java @@ -515,6 +515,7 @@ public class CacheConfig { GLOBAL_BLOCK_CACHE_INSTANCE = lruCache; } } else { + LOG.warn("SlabCache is deprecated. Consider BucketCache as a replacement."); GLOBAL_BLOCK_CACHE_INSTANCE = new DoubleBlockCache( lruCacheSize, slabCacheOffHeapCacheSize, blockSize, blockSize, conf); } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/DoubleBlockCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/DoubleBlockCache.java index 558ca20efb0..c7a1c8c8452 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/DoubleBlockCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/DoubleBlockCache.java @@ -35,8 +35,10 @@ import org.apache.hadoop.util.StringUtils; * cache before looking for the block in the off heap cache. Metrics are the * combined size and hits and misses of both caches. * - **/ + * @deprecated As of 1.0, replaced by {@link org.apache.hadoop.hbase.io.hfile.bucket.BucketCache}. + */ @InterfaceAudience.Private +@Deprecated public class DoubleBlockCache implements ResizableBlockCache, HeapSize { static final Log LOG = LogFactory.getLog(DoubleBlockCache.class.getName()); @@ -178,4 +180,4 @@ public class DoubleBlockCache implements ResizableBlockCache, HeapSize { public BlockCache[] getBlockCaches() { return new BlockCache [] {this.onHeapCache, this.offHeapCache}; } -} \ No newline at end of file +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java index d9494e458d5..383efcc106b 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java @@ -51,8 +51,10 @@ import com.google.common.cache.RemovalNotification; * Eviction and LRUness is taken care of by Guava's MapMaker, which creates a * ConcurrentLinkedHashMap. * + * @deprecated As of 1.0, replaced by {@link org.apache.hadoop.hbase.io.hfile.bucket.BucketCache}. **/ @InterfaceAudience.Private +@Deprecated public class SingleSizeCache implements BlockCache, HeapSize { private final Slab backingStore; private final ConcurrentMap backingMap; @@ -350,4 +352,4 @@ public class SingleSizeCache implements BlockCache, HeapSize { public BlockCache[] getBlockCaches() { return null; } -} \ No newline at end of file +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/Slab.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/Slab.java index 77bea490a03..637890f49c3 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/Slab.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/Slab.java @@ -33,9 +33,11 @@ import com.google.common.base.Preconditions; * Slab is a class which is designed to allocate blocks of a certain size. * Constructor creates a number of DirectByteBuffers and slices them into the * requisite size, then puts them all in a buffer. - **/ - + * + * @deprecated As of 1.0, replaced by {@link org.apache.hadoop.hbase.io.hfile.bucket.BucketCache}. + */ @InterfaceAudience.Private +@Deprecated class Slab implements org.apache.hadoop.hbase.io.HeapSize { static final Log LOG = LogFactory.getLog(Slab.class); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java index 4a264bb6eac..c4056c4456c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java @@ -57,8 +57,10 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; * *

It is configured with a call to {@link #addSlab(int, int)} * - **/ + * @deprecated As of 1.0, replaced by {@link org.apache.hadoop.hbase.io.hfile.bucket.BucketCache}. + */ @InterfaceAudience.Private +@Deprecated public class SlabCache implements SlabItemActionWatcher, BlockCache, HeapSize { private final ConcurrentHashMap backingStore; private final TreeMap slabs; @@ -508,4 +510,4 @@ public class SlabCache implements SlabItemActionWatcher, BlockCache, HeapSize { public BlockCache[] getBlockCaches() { return null; } -} \ No newline at end of file +} diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabItemActionWatcher.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabItemActionWatcher.java index fe121de3999..93b35db5cb5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabItemActionWatcher.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabItemActionWatcher.java @@ -24,8 +24,11 @@ import org.apache.hadoop.hbase.io.hfile.BlockCacheKey; /** * Interface for objects that want to know when actions occur in a SingleSizeCache. - * */ + * + * @deprecated As of 1.0, replaced by {@link org.apache.hadoop.hbase.io.hfile.bucket.BucketCache}. + */ @InterfaceAudience.Private +@Deprecated interface SlabItemActionWatcher { /** diff --git a/src/main/docbkx/book.xml b/src/main/docbkx/book.xml index a11acc67393..87beac7d08e 100644 --- a/src/main/docbkx/book.xml +++ b/src/main/docbkx/book.xml @@ -1953,7 +1953,8 @@ rs.close(); LruBlockCache is the original implementation, and is entirely within the Java heap. SlabCache and BucketCache are mainly intended for keeping blockcache data offheap, although BucketCache can also keep data onheap and in files. - BucketCache has seen more production deploys and has more deploy options. Fetching + SlabCache is deprecated and will be removed in 1.0! + BucketCache has seen more production deploys and has more deploy options. Fetching will always be slower when fetching from BucketCache or SlabCache, as compared with the native onheap LruBlockCache. However, latencies tend to be less erratic over time, because there is less garbage collection. @@ -2112,6 +2113,7 @@ rs.close(); Offheap Block Cache

Enable SlabCache + SlabCache is deprecated and will be removed in 1.0! SlabCache is originally described in Caching in Apache HBase: SlabCache. Quoting from the API documentation for