public StoreFile.Writer createWriterInTmp(int maxKeyCount, Compression.Algorithm compression, boolean isCompaction, boolean includeMVCCReadpoint) throws IOException { final CacheConfig writerCacheConf; if (isCompaction) { // Don't cache data on write on compactions. writerCacheConf = new CacheConfig(cacheConf); writerCacheConf.setCacheDataOnWrite(false); } else { writerCacheConf = cacheConf; } StoreFile.Writer w = new StoreFile.WriterBuilder(conf, writerCacheConf, fs, blocksize) .withOutputDir(region.getTmpDir()) .withDataBlockEncoder(dataBlockEncoder) .withComparator(comparator) .withBloomType(family.getBloomFilterType()) .withMaxKeyCount(maxKeyCount) .withChecksumType(checksumType) .withBytesPerChecksum(bytesPerChecksum) .withCompression(compression) .includeMVCCReadpoint(includeMVCCReadpoint) .build(); // The store file writer's path does not include the CF name, so we need // to configure the HFile writer directly. SchemaConfigured sc = (SchemaConfigured) w.writer; SchemaConfigured.resetSchemaMetricsConf(sc); passSchemaMetricsTo(sc); return w; }
@Override public void schemaConfigurationChanged() { passSchemaMetricsTo((SchemaConfigured) reader); }