diff --git hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java index 14f0260..bb5784f 100644 --- hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java +++ hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestCacheOnWriteInSchema.java @@ -19,7 +19,7 @@ package org.apache.hadoop.hbase.regionserver; -import static org.junit.Assert.*; +import static org.junit.Assert.assertTrue; import java.io.IOException; import java.util.ArrayList; @@ -52,7 +52,6 @@ import org.apache.hadoop.hbase.io.hfile.TestHFileWriterV2; import org.apache.hadoop.hbase.regionserver.StoreFile.BloomType; import org.apache.hadoop.hbase.regionserver.wal.HLog; import org.apache.hadoop.hbase.util.Bytes; - import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -63,7 +62,7 @@ import org.junit.runners.Parameterized.Parameters; /** * Tests {@link HFile} cache-on-write functionality for data blocks, non-root - * index blocks, and Bloom filter blocks, as specified by the column family. + * index blocks, and Bloom filter blocks, as specified by the column family. */ @RunWith(Parameterized.class) @Category(MediumTests.class) @@ -120,7 +119,9 @@ public class TestCacheOnWriteInSchema { private final CacheOnWriteType cowType; private Configuration conf; private final String testDescription; + private HRegion region; private HStore store; + private HLog hlog; private FileSystem fs; public TestCacheOnWriteInSchema(CacheOnWriteType cowType) { @@ -161,13 +162,15 @@ public class TestCacheOnWriteInSchema { Path oldLogDir = new Path(basedir, HConstants.HREGION_OLDLOGDIR_NAME); fs.delete(logdir, true); HRegionInfo info = new HRegionInfo(htd.getName(), null, null, false); - HLog hlog = new HLog(fs, logdir, oldLogDir, conf); - HRegion region = new HRegion(basedir, hlog, fs, conf, info, htd, null); + hlog = new HLog(fs, logdir, oldLogDir, conf); + region = new HRegion(basedir, hlog, fs, conf, info, htd, null); store = new HStore(basedir, region, hcd, fs, conf); } @After - public void tearDown() { + public void tearDown() throws IOException { + region.close(); + hlog.close(); try { fs.delete(new Path(DIR), true); } catch (IOException e) { @@ -187,7 +190,7 @@ public class TestCacheOnWriteInSchema { } private void readStoreFile(Path path) throws IOException { - CacheConfig cacheConf = store.getCacheConfig(); + CacheConfig cacheConf = store.getCacheConfig(); BlockCache cache = cacheConf.getBlockCache(); StoreFile sf = new StoreFile(fs, path, conf, cacheConf, BloomType.ROWCOL, null);