diff --git hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java index 7074c9d..6a4e2d5 100644 --- hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java +++ hbase-server/src/test/java/org/apache/hadoop/hbase/io/hfile/TestHFile.java @@ -87,6 +87,7 @@ public class TestHFile { public static void setUp() throws Exception { conf = TEST_UTIL.getConfiguration(); fs = TEST_UTIL.getTestFileSystem(); + cacheConf = new CacheConfig(conf); } @Test @@ -155,7 +156,6 @@ public class TestHFile { */ @Test public void testEmptyHFile() throws IOException { - if (cacheConf == null) cacheConf = new CacheConfig(conf); Path f = new Path(ROOT_DIR, testName.getMethodName()); HFileContext context = new HFileContextBuilder().withIncludesTags(false).build(); Writer w = @@ -172,7 +172,6 @@ public class TestHFile { */ @Test public void testCorrupt0LengthHFile() throws IOException { - if (cacheConf == null) cacheConf = new CacheConfig(conf); Path f = new Path(ROOT_DIR, testName.getMethodName()); FSDataOutputStream fsos = fs.create(f); fsos.close(); @@ -206,7 +205,6 @@ public class TestHFile { */ @Test public void testCorruptTruncatedHFile() throws IOException { - if (cacheConf == null) cacheConf = new CacheConfig(conf); Path f = new Path(ROOT_DIR, testName.getMethodName()); HFileContext context = new HFileContextBuilder().build(); Writer w = HFile.getWriterFactory(conf, cacheConf).withPath(this.fs, f) @@ -308,7 +306,6 @@ public class TestHFile { if (useTags) { conf.setInt("hfile.format.version", 3); } - if (cacheConf == null) cacheConf = new CacheConfig(conf); Path ncHFile = new Path(ROOT_DIR, "basic.hfile." + codec.toString() + useTags); FSDataOutputStream fout = createFSOutput(ncHFile); HFileContext meta = new HFileContextBuilder() @@ -404,7 +401,6 @@ public class TestHFile { } private void metablocks(final String compress) throws Exception { - if (cacheConf == null) cacheConf = new CacheConfig(conf); Path mFile = new Path(ROOT_DIR, "meta.hfile"); FSDataOutputStream fout = createFSOutput(mFile); HFileContext meta = new HFileContextBuilder() @@ -438,7 +434,6 @@ public class TestHFile { @Test public void testNullMetaBlocks() throws Exception { - if (cacheConf == null) cacheConf = new CacheConfig(conf); for (Compression.Algorithm compressAlgo : HBaseTestingUtility.COMPRESSION_ALGORITHMS) { Path mFile = new Path(ROOT_DIR, "nometa_" + compressAlgo + ".hfile");