diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java index 412f9b3cfe2..74ff546f5ba 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionFileSystem.java @@ -579,7 +579,6 @@ public class HRegionFileSystem { Path splitStoreFile(final HRegionInfo hri, final String familyName, final StoreFile f, final byte[] splitRow, final boolean top, RegionSplitPolicy splitPolicy) throws IOException { - if (splitPolicy == null || !splitPolicy.skipStoreFileRangeCheck(familyName)) { // Check whether the split row lies in the range of the store file // If it is outside the range, return directly. @@ -608,7 +607,7 @@ public class HRegionFileSystem { } } } finally { - f.closeReader(true); + f.closeReader(f.getCacheConf() != null ? f.getCacheConf().shouldEvictOnClose() : true); } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java index 133a5d95e12..184d44ffa63 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HStore.java @@ -570,9 +570,11 @@ public class HStore implements Store { } if (ioe != null) { // close StoreFile readers + boolean evictOnClose = + cacheConf != null? cacheConf.shouldEvictOnClose(): true; for (StoreFile file : results) { try { - if (file != null) file.closeReader(true); + if (file != null) file.closeReader(evictOnClose); } catch (IOException e) { LOG.warn(e.getMessage()); } @@ -1244,10 +1246,12 @@ public class HStore implements Store { if (!this.conf.getBoolean("hbase.hstore.compaction.complete", true)) { LOG.warn("hbase.hstore.compaction.complete is set to false"); sfs = new ArrayList(newFiles.size()); + final boolean evictOnClose = + cacheConf != null? cacheConf.shouldEvictOnClose(): true; for (Path newFile : newFiles) { // Create storefile around what we wrote with a reader on it. StoreFile sf = createStoreFileAndReader(newFile); - sf.closeReader(true); + sf.closeReader(evictOnClose); sfs.add(sf); } return sfs; @@ -1797,8 +1801,10 @@ public class HStore implements Store { // let the archive util decide if we should archive or delete the files LOG.debug("Removing store files after compaction..."); + boolean evictOnClose = + cacheConf != null? cacheConf.shouldEvictOnClose(): true; for (StoreFile compactedFile : compactedFiles) { - compactedFile.closeReader(true); + compactedFile.closeReader(evictOnClose); } if (removeFiles) { this.fs.removeStoreFiles(this.getColumnFamilyName(), compactedFiles); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java index 88aa151c08c..8730bb3813a 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java @@ -136,6 +136,10 @@ public class StoreFile { private Comparator comparator; + CacheConfig getCacheConf() { + return cacheConf; + } + public Cell getFirstKey() { return firstKey; } @@ -515,7 +519,9 @@ public class StoreFile { this.reader = open(canUseDropBehind); } catch (IOException e) { try { - this.closeReader(true); + boolean evictOnClose = + cacheConf != null? cacheConf.shouldEvictOnClose(): true; + this.closeReader(evictOnClose); } catch (IOException ee) { } throw e; @@ -550,7 +556,9 @@ public class StoreFile { * @throws IOException */ public void deleteReader() throws IOException { - closeReader(true); + boolean evictOnClose = + cacheConf != null? cacheConf.shouldEvictOnClose(): true; + closeReader(evictOnClose); this.fs.delete(getPath(), true); }