From a86a4b9dc7492dc8725a079776787214c137e82e Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Tue, 14 Jun 2011 23:23:52 +0000 Subject: [PATCH] HBASE-3976 Disable Block Cache On Compactions git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1135849 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + .../org/apache/hadoop/hbase/regionserver/Store.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3511cf3a861..66d96be07cf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -263,6 +263,7 @@ Release 0.91.0 - Unreleased HBASE-3982 Improvements to TestHFileSeek HBASE-3940 HBase daemons should log version info at startup and possibly periodically (Li Pi) + HBASE-3976 Disable Block Cache On Compactions (Karthick Sankarachary) TASKS HBASE-3559 Move report of split to master OFF the heartbeat channel diff --git a/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java b/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java index c9e29f903c0..87dce53e2a1 100644 --- a/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java +++ b/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java @@ -549,12 +549,18 @@ public class Store implements HeapSize { * @return Writer for a new StoreFile in the tmp dir. */ private StoreFile.Writer createWriterInTmp(int maxKeyCount, - Compression.Algorithm compression) + Compression.Algorithm compression) throws IOException { + return createWriterInTmp(maxKeyCount, compression, + conf.getBoolean("hbase.rs.cacheblocksonwrite", false)); + } + + private StoreFile.Writer createWriterInTmp(int maxKeyCount, + Compression.Algorithm compression, boolean cacheBlocksOnWrite) throws IOException { return StoreFile.createWriter(this.fs, region.getTmpDir(), this.blocksize, compression, this.comparator, this.conf, this.family.getBloomFilterType(), maxKeyCount, - conf.getBoolean("hbase.rs.cacheblocksonwrite", false)); + cacheBlocksOnWrite); } /* @@ -1097,7 +1103,7 @@ public class Store implements HeapSize { while (scanner.next(kvs)) { if (writer == null && !kvs.isEmpty()) { writer = createWriterInTmp(maxKeyCount, - this.compactionCompression); + this.compactionCompression, false); } if (writer != null) { // output to writer: