You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zg...@apache.org on 2018/12/19 06:14:46 UTC

hbase git commit: HBASE-21514: Refactor CacheConfig(addendum)

Repository: hbase
Updated Branches:
  refs/heads/master fb58a23e5 -> 8991877bb


HBASE-21514: Refactor CacheConfig(addendum)


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

Branch: refs/heads/master
Commit: 8991877bb250ee1fe66c2b9a491645973927d674
Parents: fb58a23
Author: Guanghao Zhang <zg...@apache.org>
Authored: Tue Dec 18 16:46:34 2018 +0800
Committer: Guanghao Zhang <zg...@apache.org>
Committed: Wed Dec 19 13:55:13 2018 +0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/8991877b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
index 0fc9576..d095ceb 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java
@@ -1300,8 +1300,8 @@ public class HFileReaderImpl implements HFile.Reader, Configurable {
       boolean isCompaction, boolean updateCacheMetrics, BlockType expectedBlockType,
       DataBlockEncoding expectedDataBlockEncoding) throws IOException {
     // Check cache for block. If found return.
-    if (cacheConf.getBlockCache().isPresent()) {
-      BlockCache cache = cacheConf.getBlockCache().get();
+    BlockCache cache = cacheConf.getBlockCache().orElse(null);
+    if (cache != null) {
       HFileBlock cachedBlock =
           (HFileBlock) cache.getBlock(cacheKey, cacheBlock, useLock, updateCacheMetrics);
       if (cachedBlock != null) {