From 9f2204fbe33fa351f75291a16a0ef8607cf9c36d Mon Sep 17 00:00:00 2001 From: larsh Date: Wed, 26 Oct 2011 21:32:43 +0000 Subject: [PATCH] HBASE-4673 NPE in HFileReaderV2.close during major compaction when hfile.block.cache.size is set to 0 git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1189481 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 4 +++- .../java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ca44448fa8a..b1a698b1b36 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -27,7 +27,9 @@ Release 0.93.0 - Unreleased BUG FIXES HBASE-4488 Store could miss rows during flush (Lars H via jgray) - + HBASE-4673 NPE in HFileReaderV2.close during major compaction when + hfile.block.cache.size is set to 0 (Lars H) + TESTS HBASE-4534 A new unit test for lazy seek and StoreScanner in general (mikhail via jgray) diff --git a/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java b/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java index 29b43fb5ac5..3f94396927f 100644 --- a/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java +++ b/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderV2.java @@ -323,7 +323,7 @@ public class HFileReaderV2 extends AbstractHFileReader { } public void close(boolean evictOnClose) throws IOException { - if (evictOnClose) { + if (evictOnClose && cacheConf.isBlockCacheEnabled()) { int numEvicted = cacheConf.getBlockCache().evictBlocksByPrefix(name + HFile.CACHE_KEY_SEPARATOR); LOG.debug("On close of file " + name + " evicted " + numEvicted