You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nd...@apache.org on 2014/06/13 18:42:36 UTC

git commit: HBASE-11307 Deprecate SlabCache

Repository: hbase
Updated Branches:
  refs/heads/master 8e547f3ba -> 632301f52


HBASE-11307 Deprecate SlabCache


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

Branch: refs/heads/master
Commit: 632301f52537f44df0575b5441e3b12fa82b485f
Parents: 8e547f3
Author: Nick Dimiduk <nd...@apache.org>
Authored: Thu Jun 12 16:44:55 2014 -0700
Committer: Nick Dimiduk <nd...@apache.org>
Committed: Fri Jun 13 09:40:44 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java     | 1 +
 .../org/apache/hadoop/hbase/io/hfile/DoubleBlockCache.java     | 6 ++++--
 .../org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java | 4 +++-
 .../main/java/org/apache/hadoop/hbase/io/hfile/slab/Slab.java  | 6 ++++--
 .../java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java  | 6 ++++--
 .../hadoop/hbase/io/hfile/slab/SlabItemActionWatcher.java      | 5 ++++-
 src/main/docbkx/book.xml                                       | 4 +++-
 7 files changed, 23 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/CacheConfig.java
----------------------------------------------------------------------
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 de6aec7..f017701 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);
     }

http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/DoubleBlockCache.java
----------------------------------------------------------------------
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 558ca20..c7a1c8c 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
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SingleSizeCache.java
----------------------------------------------------------------------
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 d9494e4..383efcc 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<BlockCacheKey, CacheablePair> backingMap;
@@ -350,4 +352,4 @@ public class SingleSizeCache implements BlockCache, HeapSize {
   public BlockCache[] getBlockCaches() {
     return null;
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/Slab.java
----------------------------------------------------------------------
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 77bea49..637890f 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);
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabCache.java
----------------------------------------------------------------------
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 4a264bb..c4056c4 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;
  * 
  * <p>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<BlockCacheKey, SingleSizeCache> backingStore;
   private final TreeMap<Integer, SingleSizeCache> slabs;
@@ -508,4 +510,4 @@ public class SlabCache implements SlabItemActionWatcher, BlockCache, HeapSize {
   public BlockCache[] getBlockCaches() {
     return null;
   }
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/slab/SlabItemActionWatcher.java
----------------------------------------------------------------------
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 fe121de..93b35db 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 {
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/632301f5/src/main/docbkx/book.xml
----------------------------------------------------------------------
diff --git a/src/main/docbkx/book.xml b/src/main/docbkx/book.xml
index a11acc6..87beac7 100644
--- a/src/main/docbkx/book.xml
+++ b/src/main/docbkx/book.xml
@@ -1953,7 +1953,8 @@ rs.close();
           <para>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.</para>
-          <para> BucketCache has seen more production deploys and has more deploy options. Fetching
+          <para><emphasis>SlabCache is deprecated and will be removed in 1.0!</emphasis></para>
+          <para>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.</para>
@@ -2112,6 +2113,7 @@ rs.close();
           <title>Offheap Block Cache</title>
           <section>
             <title>Enable SlabCache</title>
+            <para><emphasis>SlabCache is deprecated and will be removed in 1.0!</emphasis></para>
             <para> SlabCache is originally described in <link
                 xlink:href="http://blog.cloudera.com/blog/2012/01/caching-in-hbase-slabcache/">Caching
                 in Apache HBase: SlabCache</link>. Quoting from the API documentation for <link