You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ns...@apache.org on 2012/01/20 03:23:02 UTC

svn commit: r1233731 - in /hbase/branches/0.89-fb/src: main/java/org/apache/hadoop/hbase/io/hfile/ main/java/org/apache/hadoop/hbase/regionserver/ test/java/org/apache/hadoop/hbase/io/hfile/ test/java/org/apache/hadoop/hbase/regionserver/

Author: nspiegelberg
Date: Fri Jan 20 02:23:02 2012
New Revision: 1233731

URL: http://svn.apache.org/viewvc?rev=1233731&view=rev
Log:
[HBASE-3976] Control cacheOnWrite separately for compaction and flush

Summary:
In most of use cases, we want to control cacheOnWrite differently during
compaction and flush time.  So whether enable the cacheOnWrite should be
controlled on the store level.

Public revision: https://reviews.facebook.net/D1251

Test Plan: running all the unit tests now

Reviewers: kannan

CC: hbase-eng@lists, ods-storage@lists

Differential Revision: https://phabricator.fb.com/D389333

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV1.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java
    hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/AbstractHFileWriter.java Fri Jan 20 02:23:02 2012
@@ -115,9 +115,12 @@ public abstract class AbstractHFileWrite
    */
   protected final String name;
 
+  protected final boolean allowCacheOnWrite;
+
   public AbstractHFileWriter(Configuration conf,
       FSDataOutputStream outputStream, Path path, int blockSize,
-      Compression.Algorithm compressAlgo, KeyComparator comparator) {
+      Compression.Algorithm compressAlgo, KeyComparator comparator,
+      boolean allowCacheOnWrite) {
     super(conf, path);
     this.outputStream = outputStream;
     this.path = path;
@@ -130,9 +133,11 @@ public abstract class AbstractHFileWrite
 
     closeOutputStream = path != null;
 
-    cacheDataBlocksOnWrite = conf.getBoolean(HFile.CACHE_BLOCKS_ON_WRITE_KEY,
-        false);
-    cacheIndexBlocksOnWrite = HFileBlockIndex.shouldCacheOnWrite(conf);
+    this.allowCacheOnWrite = allowCacheOnWrite;
+    cacheDataBlocksOnWrite = allowCacheOnWrite &&
+      conf.getBoolean(HFile.CACHE_DATA_BLOCKS_ON_WRITE_KEY, false);
+    cacheIndexBlocksOnWrite = allowCacheOnWrite &&
+      HFileBlockIndex.shouldCacheOnWrite(conf);
 
     this.conf = conf;
 

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java Fri Jan 20 02:23:02 2012
@@ -40,7 +40,6 @@ import org.apache.hadoop.fs.PathFilter;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.KeyComparator;
 import org.apache.hadoop.hbase.io.HbaseMapWritable;
-import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics;
 import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics.SchemaAware;
 import org.apache.hadoop.hbase.util.BloomFilterWriter;
 import org.apache.hadoop.hbase.util.Bytes;
@@ -256,7 +255,8 @@ public class HFile {
 
     public abstract Writer createWriter(FileSystem fs, Path path,
         int blockSize, int bytesPerChecksum, Compression.Algorithm compress,
-        final KeyComparator comparator, InetSocketAddress[] favoredNodes)
+        final KeyComparator comparator, InetSocketAddress[] favoredNodes,
+        boolean allowCacheOnWrite)
         throws IOException;
 
     public abstract Writer createWriter(FileSystem fs, Path path,
@@ -311,7 +311,7 @@ public class HFile {
    * Configuration key to cache data blocks on write. There are separate
    * switches for Bloom blocks and non-root index blocks.
    */
-  public static final String CACHE_BLOCKS_ON_WRITE_KEY =
+  public static final String CACHE_DATA_BLOCKS_ON_WRITE_KEY =
       "hbase.rs.cacheblocksonwrite";
 
   /** An abstraction used by the block index */

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV1.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV1.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV1.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV1.java Fri Jan 20 02:23:02 2012
@@ -90,8 +90,7 @@ public class HFileWriterV1 extends Abstr
     @Override
     public Writer createWriter(FileSystem fs, Path path, int blockSize,
         int bytesPerChecksum, Compression.Algorithm compressAlgo,
-        final KeyComparator comparator)
-        throws IOException {
+        final KeyComparator comparator) throws IOException {
       return new HFileWriterV1(conf, fs, path, blockSize, bytesPerChecksum,
           compressAlgo, comparator);
     }
@@ -99,10 +98,10 @@ public class HFileWriterV1 extends Abstr
     @Override
     public Writer createWriter(FileSystem fs, Path path, int blockSize,
         int bytesPerChecksum, Compression.Algorithm compressAlgo,
-        final KeyComparator comparator, InetSocketAddress[] favoredNodes)
-        throws IOException {
+        final KeyComparator comparator, InetSocketAddress[] favoredNodes,
+        boolean allowCacheOnWrite) throws IOException {
       return new HFileWriterV1(conf, fs, path, blockSize, bytesPerChecksum,
-          compressAlgo, comparator, favoredNodes);
+          compressAlgo, comparator, favoredNodes, allowCacheOnWrite);
     }
 
     @Override
@@ -152,16 +151,16 @@ public class HFileWriterV1 extends Abstr
       int blockSize, int bytesPerChecksum, Compression.Algorithm compress,
       final KeyComparator comparator) throws IOException {
     super(conf, createOutputStream(conf, fs, path, bytesPerChecksum), path,
-        blockSize, compress, comparator);
+        blockSize, compress, comparator, true);
   }
 
   /** Constructor that takes a path, creates and closes the output stream. */
   public HFileWriterV1(Configuration conf, FileSystem fs, Path path,
       int blockSize, int bytesPerChecksum, Compression.Algorithm compress,
-      final KeyComparator comparator, InetSocketAddress[] favoredNodes)
-      throws IOException {
+      final KeyComparator comparator, InetSocketAddress[] favoredNodes,
+      boolean allowCacheOnWrite) throws IOException {
     super(conf, createOutputStream(conf, fs, path, bytesPerChecksum,
-        favoredNodes), path, blockSize, compress, comparator);
+        favoredNodes), path, blockSize, compress, comparator, allowCacheOnWrite);
   }
 
   /** Constructor that takes a stream. */
@@ -179,7 +178,7 @@ public class HFileWriterV1 extends Abstr
       final FSDataOutputStream outputStream, final int blockSize,
       final Compression.Algorithm compress, final KeyComparator comparator)
       throws IOException {
-    super(conf, outputStream, null, blockSize, compress, comparator);
+    super(conf, outputStream, null, blockSize, compress, comparator, true);
   }
 
   /**

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileWriterV2.java Fri Jan 20 02:23:02 2012
@@ -35,7 +35,6 @@ import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.KeyComparator;
 import org.apache.hadoop.hbase.io.hfile.HFile.Writer;
 import org.apache.hadoop.hbase.io.hfile.HFileBlock.BlockWritable;
-import org.apache.hadoop.hbase.util.BloomFilterFactory;
 import org.apache.hadoop.hbase.util.BloomFilterWriter;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.io.Writable;
@@ -97,10 +96,10 @@ public class HFileWriterV2 extends Abstr
     @Override
     public Writer createWriter(FileSystem fs, Path path, int blockSize,
         int bytesPerChecksum, Compression.Algorithm compress,
-        final KeyComparator comparator, InetSocketAddress[] favoredNodes)
-        throws IOException {
+        final KeyComparator comparator, InetSocketAddress[] favoredNodes,
+        boolean allowCacheOnWrite) throws IOException {
       return new HFileWriterV2(conf, fs, path, blockSize, bytesPerChecksum,
-          compress, comparator, favoredNodes);
+          compress, comparator, favoredNodes, allowCacheOnWrite);
     }
 
     @Override
@@ -150,17 +149,18 @@ public class HFileWriterV2 extends Abstr
       int blockSize, int bytesPerChecksum, Compression.Algorithm compressAlgo,
       final KeyComparator comparator) throws IOException {
     super(conf, createOutputStream(conf, fs, path, bytesPerChecksum), path,
-        blockSize, compressAlgo, comparator);
+        blockSize, compressAlgo, comparator, true);
     finishInit(conf);
   }
 
   /** Constructor that takes a path, creates and closes the output stream. */
   public HFileWriterV2(Configuration conf, FileSystem fs, Path path,
       int blockSize, int bytesPerChecksum, Compression.Algorithm compressAlgo,
-      final KeyComparator comparator, InetSocketAddress[] favoredNodes)
-      throws IOException {
+      final KeyComparator comparator, InetSocketAddress[] favoredNodes,
+      boolean allowCacheOnWrite) throws IOException {
     super(conf, createOutputStream(conf, fs, path, bytesPerChecksum,
-        favoredNodes), path, blockSize, compressAlgo, comparator);
+        favoredNodes), path, blockSize, compressAlgo, comparator,
+        allowCacheOnWrite);
     finishInit(conf);
   }
 
@@ -179,7 +179,7 @@ public class HFileWriterV2 extends Abstr
       final FSDataOutputStream outputStream, final int blockSize,
       final Compression.Algorithm compress, final KeyComparator comparator)
       throws IOException {
-    super(conf, outputStream, null, blockSize, compress, comparator);
+    super(conf, outputStream, null, blockSize, compress, comparator, true);
     finishInit(conf);
   }
 
@@ -251,7 +251,7 @@ public class HFileWriterV2 extends Abstr
     for (InlineBlockWriter ibw : inlineBlockWriters) {
       while (ibw.shouldWriteBlock(closing)) {
         long offset = outputStream.getPos();
-        boolean cacheThisBlock = ibw.cacheOnWrite();
+        boolean cacheThisBlock = ibw.cacheOnWrite() && this.allowCacheOnWrite;
         ibw.writeInlineBlock(fsBlockWriter.startWriting(
             ibw.getInlineBlockType(), cacheThisBlock));
         fsBlockWriter.writeHeaderAndData(outputStream);
@@ -472,7 +472,7 @@ public class HFileWriterV2 extends Abstr
   @Override
   public void addInlineBlockWriter(InlineBlockWriter ibw) {
     inlineBlockWriters.add(ibw);
-    if (blockCache == null && ibw.cacheOnWrite())
+    if (blockCache == null && ibw.cacheOnWrite() && this.allowCacheOnWrite)
       initBlockCache();
   }
 

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/Store.java Fri Jan 20 02:23:02 2012
@@ -582,7 +582,7 @@ public class Store extends SchemaConfigu
       synchronized (flushLock) {
         status.setStatus("Flushing " + this + ": creating writer");
         // A. Write the map out to the disk
-        writer = createWriterInTmp(snapshot.size());
+        writer = createWriterInTmp(snapshot.size(), true);
         writer.setTimeRangeTracker(snapshotTimeRangeTracker);
         fileName = writer.getPath().getName();
         int entries = 0;
@@ -653,12 +653,13 @@ public class Store extends SchemaConfigu
   /*
    * @return Writer for a new StoreFile in the tmp dir.
    */
-  private StoreFile.Writer createWriterInTmp(long maxKeyCount)
+  private StoreFile.Writer createWriterInTmp(long maxKeyCount,
+      boolean allowCacheOnWrite)
   throws IOException {
     return StoreFile.createWriter(this.fs, region.getTmpDir(), this.blocksize,
         this.compression, this.comparator, this.conf,
         this.family.getBloomFilterType(), this.family.getBloomFilterErrorRate(),
-        maxKeyCount, region.getFavoredNodes());
+        maxKeyCount, region.getFavoredNodes(), allowCacheOnWrite);
   }
 
   /*
@@ -1277,7 +1278,7 @@ public class Store extends SchemaConfigu
         ArrayList<KeyValue> kvs = new ArrayList<KeyValue>();
         while (scanner.next(kvs)) {
           if (writer == null && !kvs.isEmpty()) {
-            writer = createWriterInTmp(maxKeyCount);
+            writer = createWriterInTmp(maxKeyCount, false);
           }
           if (writer != null) {
             // output to writer:

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java (original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/regionserver/StoreFile.java Fri Jan 20 02:23:02 2012
@@ -56,9 +56,8 @@ import org.apache.hadoop.hbase.io.hfile.
 import org.apache.hadoop.hbase.io.hfile.HFileWriterV1;
 import org.apache.hadoop.hbase.io.hfile.HFileWriterV2;
 import org.apache.hadoop.hbase.io.hfile.LruBlockCache;
-import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics;
 import org.apache.hadoop.hbase.regionserver.metrics.SchemaConfigured;
-import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics.SchemaAware;
+import org.apache.hadoop.hbase.regionserver.metrics.SchemaMetrics;
 import org.apache.hadoop.hbase.util.BloomFilter;
 import org.apache.hadoop.hbase.util.BloomFilterFactory;
 import org.apache.hadoop.hbase.util.BloomFilterWriter;
@@ -632,7 +631,7 @@ public class StoreFile {
           long maxKeyCount)
   throws IOException {
       return createWriter(fs, dir, blocksize, algorithm, c, conf, bloomType,
-        BloomFilterFactory.getErrorRate(conf), maxKeyCount, null);
+        BloomFilterFactory.getErrorRate(conf), maxKeyCount, null, true);
   }
 
   /**
@@ -661,7 +660,8 @@ public class StoreFile {
                                               BloomType bloomType,
                                               float bloomErrorRate,
                                               long maxKeyCount,
-                                              InetSocketAddress[] favoredNodes)
+                                              InetSocketAddress[] favoredNodes,
+                                              boolean allowCacheOnWrite)
       throws IOException {
 
     if (!fs.exists(dir)) {
@@ -675,7 +675,7 @@ public class StoreFile {
     return new Writer(fs, path, blocksize,
         algorithm == null? HFile.DEFAULT_COMPRESSION_ALGORITHM: algorithm,
         conf, c == null ? KeyValue.COMPARATOR: c, bloomType, bloomErrorRate,
-        maxKeyCount, favoredNodes);
+        maxKeyCount, favoredNodes, allowCacheOnWrite);
   }
 
   /**
@@ -785,7 +785,7 @@ public class StoreFile {
             final KVComparator comparator, BloomType bloomType,  long maxKeys)
             throws IOException {
      this(fs, path, blocksize, compress, conf, comparator, bloomType,
-          BloomFilterFactory.getErrorRate(conf), maxKeys, null);
+          BloomFilterFactory.getErrorRate(conf), maxKeys, null, true);
     }
 
     public Writer(FileSystem fs, Path path, int blocksize,
@@ -793,7 +793,7 @@ public class StoreFile {
         final KVComparator comparator, BloomType bloomType,
         float bloomErrorRate, long maxKeys) throws IOException {
       this(fs, path, blocksize, compress, conf, comparator, bloomType,
-          bloomErrorRate, maxKeys, null);
+          bloomErrorRate, maxKeys, null, true);
     }
 
     /**
@@ -814,12 +814,13 @@ public class StoreFile {
     public Writer(FileSystem fs, Path path, int blocksize,
         Compression.Algorithm compress, final Configuration conf,
         final KVComparator comparator, BloomType bloomType,
-        float bloomErrorRate, long maxKeys, InetSocketAddress[] favoredNodes)
-        throws IOException {
+        float bloomErrorRate, long maxKeys, InetSocketAddress[] favoredNodes,
+        boolean allowCacheOnWrite) throws IOException {
 
       writer = HFile.getWriterFactory(conf).createWriter(
           fs, path, blocksize, HFile.getBytesPerChecksum(conf, fs.getConf()),
-          compress, comparator.getRawComparator(), favoredNodes);
+          compress, comparator.getRawComparator(), favoredNodes,
+          allowCacheOnWrite);
 
       this.kvComparator = comparator;
 

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/io/hfile/TestCacheOnWrite.java Fri Jan 20 02:23:02 2012
@@ -20,6 +20,9 @@
 
 package org.apache.hadoop.hbase.io.hfile;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -34,14 +37,6 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.KeyValue;
-import org.apache.hadoop.hbase.io.hfile.BlockCache;
-import org.apache.hadoop.hbase.io.hfile.Compression;
-import org.apache.hadoop.hbase.io.hfile.HFile;
-import org.apache.hadoop.hbase.io.hfile.HFileBlock;
-import org.apache.hadoop.hbase.io.hfile.HFileBlockIndex;
-import org.apache.hadoop.hbase.io.hfile.HFileReaderV2;
-import org.apache.hadoop.hbase.io.hfile.HFileScanner;
-import org.apache.hadoop.hbase.io.hfile.TestHFileWriterV2;
 import org.apache.hadoop.hbase.regionserver.CreateRandomStoreFile;
 import org.apache.hadoop.hbase.regionserver.StoreFile;
 import org.apache.hadoop.hbase.util.BloomFilterFactory;
@@ -51,7 +46,6 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.junit.runners.Parameterized.Parameters;
-import static org.junit.Assert.*;
 
 /**
  * Tests {@link HFile} cache-on-write functionality for the following block
@@ -79,7 +73,7 @@ public class TestCacheOnWrite {
   private static final int BLOOM_BLOCK_SIZE = 4096;
 
   private static enum CacheOnWriteType {
-    DATA_BLOCKS(BlockType.DATA, HFile.CACHE_BLOCKS_ON_WRITE_KEY),
+    DATA_BLOCKS(BlockType.DATA, HFile.CACHE_DATA_BLOCKS_ON_WRITE_KEY),
     BLOOM_BLOCKS(BlockType.BLOOM_CHUNK,
         BloomFilterFactory.IO_STOREFILE_BLOOM_CACHE_ON_WRITE),
     INDEX_BLOCKS(BlockType.LEAF_INDEX,

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestCompoundBloomFilter.java Fri Jan 20 02:23:02 2012
@@ -282,7 +282,7 @@ public class TestCompoundBloomFilter {
       throws IOException {
     conf.setInt(BloomFilterFactory.IO_STOREFILE_BLOOM_BLOCK_SIZE,
         BLOOM_BLOCK_SIZES[t]);
-    conf.setBoolean(HFile.CACHE_BLOCKS_ON_WRITE_KEY, true);
+    conf.setBoolean(HFile.CACHE_DATA_BLOCKS_ON_WRITE_KEY, true);
 
     StoreFile.Writer w = StoreFile.createWriter(fs,
         HBaseTestingUtility.getTestDir(), BLOCK_SIZES[t], null, null, conf,

Modified: hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java?rev=1233731&r1=1233730&r2=1233731&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java (original)
+++ hbase/branches/0.89-fb/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java Fri Jan 20 02:23:02 2012
@@ -713,7 +713,7 @@ public class TestStoreFile extends HBase
     long startEvicted = cs.getEvictedCount();
 
     // Let's write a StoreFile with three blocks, with cache on write off
-    conf.setBoolean(HFile.CACHE_BLOCKS_ON_WRITE_KEY, false);
+    conf.setBoolean(HFile.CACHE_DATA_BLOCKS_ON_WRITE_KEY, false);
     Path pathCowOff = new Path(baseDir, "123456789");
     StoreFile.Writer writer = writeStoreFile(conf, pathCowOff, 3);
     StoreFile hsf = new StoreFile(this.fs, writer.getPath(), true, conf,
@@ -734,7 +734,7 @@ public class TestStoreFile extends HBase
     reader.close();
 
     // Now write a StoreFile with three blocks, with cache on write on
-    conf.setBoolean(HFile.CACHE_BLOCKS_ON_WRITE_KEY, true);
+    conf.setBoolean(HFile.CACHE_DATA_BLOCKS_ON_WRITE_KEY, true);
     Path pathCowOn = new Path(baseDir, "123456788");
     writer = writeStoreFile(conf, pathCowOn, 3);
     hsf = new StoreFile(this.fs, writer.getPath(), true, conf,