From 416ca9c6d995420e494511bb9814e55e01b51229 Mon Sep 17 00:00:00 2001 From: Biju Nair Date: Sun, 5 May 2019 22:04:39 -0400 Subject: [PATCH] HBASE-17028 Update doc with the availability of TinyLfuBlockCache --- src/main/asciidoc/_chapters/architecture.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git src/main/asciidoc/_chapters/architecture.adoc src/main/asciidoc/_chapters/architecture.adoc index 2c9aabd048..be7e3e26c3 100644 --- src/main/asciidoc/_chapters/architecture.adoc +++ src/main/asciidoc/_chapters/architecture.adoc @@ -718,7 +718,7 @@ Documentation will eventually move to this reference guide, but the blog is the === Block Cache HBase provides two different BlockCache implementations to cache data read from HDFS: -the default on-heap `LruBlockCache` and the `BucketCache`, which is (usually) off-heap. +the default on-heap `BlockCache` and the `BucketCache`, which is (usually) off-heap. This section discusses benefits and drawbacks of each implementation, how to choose the appropriate option, and configuration options for each. @@ -731,14 +731,14 @@ See configurations, sizings, current usage, time-in-the-cache, and even detail o ==== Cache Choices -`LruBlockCache` is the original implementation, and is entirely within the Java heap. +Two implementations of onheap `BlockCache` is supported by HBase. The original implementation `LruBlockCache` which uses `LRU` eviction policy and `TinyLfuBlockCache` which uses `W-TinyLFU` policy for eviction, and is stored entirely within the Java heap. By default `LruBlockCache` is enabled and can be switched to use `TinyLfuBlockCache` by setting `hfile.block.cache.policy` property to `TinyLFU` and restarting the regionservers. It is important to note that `TinyLfuBlockCache` will not give priority in retaining table data blocks defined as `in-memory` i.e. all the blocks in cache are given the same priority for eviction. To revert back to `LruBlockCache`, the property `hfile.block.cache.policy` need be unset or set to `LRU` and the regionservers restarted. Details about `TinyLfuBlockCache` can be found in link:https://issues.apache.org/jira/browse/HBASE-15560[HBASE-15560]. + `BucketCache` is optional and mainly intended for keeping block cache data off-heap, although `BucketCache` can also be a file-backed cache. - In file-backed we can either use it in the file mode or the mmaped mode. - We also have pmem mode where the bucket cache resides on the persistent memory device. + In file-backed we can either use it in the file mode or the mmaped mode. We also have pmem mode where the bucket cache resides on the persistent memory device. When you enable BucketCache, you are enabling a two tier caching system. We used to describe the tiers as "L1" and "L2" but have deprecated this terminology as of hbase-2.0.0. The "L1" cache referred to an -instance of LruBlockCache and "L2" to an off-heap BucketCache. Instead, when BucketCache is enabled, +instance of onheap BlockCache and "L2" to an off-heap BucketCache. Instead, when BucketCache is enabled, all DATA blocks are kept in the BucketCache tier and meta blocks -- INDEX and BLOOM blocks -- are on-heap in the `LruBlockCache`. Management of these two tiers and the policy that dictates how blocks move between them is done by `CombinedBlockCache`. -- 2.20.1 (Apple Git-117)