diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java index c911e8c8677..274a5066880 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/HFileOutputFormat2.java @@ -414,8 +414,6 @@ public class HFileOutputFormat2 DataBlockEncoding encoding = overriddenEncoding; encoding = encoding == null ? datablockEncodingMap.get(tableAndFamily) : encoding; encoding = encoding == null ? DataBlockEncoding.NONE : encoding; - Configuration tempConf = new Configuration(conf); - tempConf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.0f); HFileContextBuilder contextBuilder = new HFileContextBuilder() .withCompression(compression) .withChecksumType(HStore.getChecksumType(conf)) @@ -430,12 +428,12 @@ public class HFileOutputFormat2 HFileContext hFileContext = contextBuilder.build(); if (null == favoredNodes) { wl.writer = - new StoreFileWriter.Builder(conf, new CacheConfig(tempConf), fs) + new StoreFileWriter.Builder(conf, CacheConfig.DISABLED, fs) .withOutputDir(familydir).withBloomType(bloomType) .withComparator(CellComparator.getInstance()).withFileContext(hFileContext).build(); } else { wl.writer = - new StoreFileWriter.Builder(conf, new CacheConfig(tempConf), new HFileSystem(fs)) + new StoreFileWriter.Builder(conf, CacheConfig.DISABLED, new HFileSystem(fs)) .withOutputDir(familydir).withBloomType(bloomType) .withComparator(CellComparator.getInstance()).withFileContext(hFileContext) .withFavoredNodes(favoredNodes).build(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java index 5bcaa172d1d..78ebedc37f1 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java @@ -356,9 +356,7 @@ public class HFile { */ public static final WriterFactory getWriterFactoryNoCache(Configuration conf) { - Configuration tempConf = new Configuration(conf); - tempConf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.0f); - return HFile.getWriterFactory(conf, new CacheConfig(tempConf)); + return HFile.getWriterFactory(conf, CacheConfig.DISABLED); } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java index 82e881ba1f8..5a6f6c12e96 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFilePrettyPrinter.java @@ -309,7 +309,7 @@ public class HFilePrettyPrinter extends Configured implements Tool { return -2; } - HFile.Reader reader = HFile.createReader(fs, file, new CacheConfig(getConf()), true, getConf()); + HFile.Reader reader = HFile.createReader(fs, file, CacheConfig.DISABLED, true, getConf()); Map fileInfo = reader.loadFileInfo(); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java index e027ac68c39..3320b1fb7fe 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java @@ -710,7 +710,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool { Path hfilePath = item.getFilePath(); Optional first, last; try (HFile.Reader hfr = HFile.createReader(hfilePath.getFileSystem(getConf()), hfilePath, - new CacheConfig(getConf()), true, getConf())) { + CacheConfig.DISABLED, true, getConf())) { hfr.loadFileInfo(); first = hfr.getFirstRowKey(); last = hfr.getLastRowKey(); @@ -847,7 +847,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool { throws IOException { Path hfile = hfileStatus.getPath(); try (HFile.Reader reader = - HFile.createReader(fs, hfile, new CacheConfig(getConf()), true, getConf())) { + HFile.createReader(fs, hfile, CacheConfig.DISABLED, true, getConf())) { if (builder.getCompressionType() != reader.getFileContext().getCompression()) { builder.setCompressionType(reader.getFileContext().getCompression()); LOG.info("Setting compression " + reader.getFileContext().getCompression().name() + @@ -1083,7 +1083,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool { private static void copyHFileHalf(Configuration conf, Path inFile, Path outFile, Reference reference, ColumnFamilyDescriptor familyDescriptor) throws IOException { FileSystem fs = inFile.getFileSystem(conf); - CacheConfig cacheConf = new CacheConfig(conf); + CacheConfig cacheConf = CacheConfig.DISABLED; HalfStoreFileReader halfReader = null; StoreFileWriter halfWriter = null; try { diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java index b6af8a55073..dcdd12ed4ae 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/CompressionTest.java @@ -134,7 +134,7 @@ public class CompressionTest { writer.appendFileInfo(Bytes.toBytes("compressioninfokey"), Bytes.toBytes("compressioninfoval")); writer.close(); Cell cc = null; - HFile.Reader reader = HFile.createReader(fs, path, new CacheConfig(conf), true, conf); + HFile.Reader reader = HFile.createReader(fs, path, CacheConfig.DISABLED, true, conf); try { reader.loadFileInfo(); HFileScanner scanner = reader.getScanner(false, true); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java index 14706c54278..8176942364c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java @@ -922,7 +922,7 @@ public class HBaseFsck extends Configured implements Closeable { // For all the stores in this column family. for (FileStatus storeFile : storeFiles) { HFile.Reader reader = HFile.createReader(fs, storeFile.getPath(), - new CacheConfig(getConf()), true, getConf()); + CacheConfig.DISABLED, true, getConf()); if ((reader.getFirstKey() != null) && ((storeFirstKey == null) || (comparator.compare(storeFirstKey, ((KeyValue.KeyOnlyKeyValue) reader.getFirstKey().get()).getKey()) > 0))) { @@ -1025,8 +1025,7 @@ public class HBaseFsck extends Configured implements Closeable { byte[] start, end; HFile.Reader hf = null; try { - CacheConfig cacheConf = new CacheConfig(getConf()); - hf = HFile.createReader(fs, hfile.getPath(), cacheConf, true, getConf()); + hf = HFile.createReader(fs, hfile.getPath(), CacheConfig.DISABLED, true, getConf()); hf.loadFileInfo(); Optional startKv = hf.getFirstKey(); start = CellUtil.cloneRow(startKv.get()); diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java index e937fa529aa..41f3cde67ec 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/util/hbck/HFileCorruptionChecker.java @@ -82,7 +82,7 @@ public class HFileCorruptionChecker { boolean quarantine) throws IOException { this.conf = conf; this.fs = FileSystem.get(conf); - this.cacheConf = new CacheConfig(conf); + this.cacheConf = CacheConfig.DISABLED; this.executor = executor; this.inQuarantineMode = quarantine; }