/** @return compression type being used for the column family */ public Compression.Algorithm getCompression() { String n = getValue(COMPRESSION); if (n == null) { return Compression.Algorithm.NONE; } return Compression.Algorithm.valueOf(n.toUpperCase()); }
public HFileSortedOplogWriter(int keys) throws IOException { try { int hfileBlockSize = Integer.getInteger( HoplogConfig.HFILE_BLOCK_SIZE_CONF, (1 << 16)); Algorithm compress = Algorithm.valueOf(System.getProperty(HoplogConfig.COMPRESSION, HoplogConfig.COMPRESSION_DEFAULT)); // ByteComparator bc = new ByteComparator(); writer = HFile.getWriterFactory(conf, cacheConf) .withPath(fsProvider.getFS(), path) .withBlockSize(hfileBlockSize) // .withComparator(bc) .withCompression(compress) .create(); // bfw = BloomFilterFactory.createGeneralBloomAtWrite(conf, cacheConf, BloomType.ROW, keys, // writer, bc); bfw = BloomFilterFactory.createGeneralBloomAtWrite(conf, cacheConf, BloomType.ROW, keys, writer); if (logger.isDebugEnabled()) logger.debug("{}Created hoplog writer with compression " + compress, logPrefix); } catch (IOException e) { if (logger.isDebugEnabled()) logger.debug("{}IO Error while creating writer", logPrefix); throw e; } }
/** @return compression type being used for the column family for major compression */ public Compression.Algorithm getCompactionCompression() { String n = getValue(COMPRESSION_COMPACT); if (n == null) { return getCompression(); } return Compression.Algorithm.valueOf(n.toUpperCase()); }
setTimeToLive(timeToLive); setCompressionType(Compression.Algorithm. valueOf(compression.toUpperCase())); setEncodeOnDisk(encodeOnDisk); setDataBlockEncoding(DataBlockEncoding.
columnDescriptor.setCompressionType(Algorithm.valueOf(compression)); if(blockCache != null) columnDescriptor.setBlockCacheEnabled(Boolean.parseBoolean(blockCache));
public static ColumnFamilyConfig buildCfConfig(Conf conf) { ColumnFamilyConfig family = new ColumnFamilyConfig(); String compression = conf.getChild("compression").getValue(null); if (compression != null) { family.setCompression(Compression.Algorithm.valueOf(compression.toUpperCase())); } String bloomFilter = conf.getChild("bloomFilter").getValue(null); if (bloomFilter != null) { family.setBoomFilter(StoreFile.BloomType.valueOf(bloomFilter.toUpperCase())); } Integer blockSize = conf.getChild("blockSize").getValueAsInteger(null); if (blockSize != null) { family.setBlockSize(blockSize); } return family; } }
@Override public void setCompression(HColumnDescriptor cd, String algo) { cd.setCompressionType(Compression.Algorithm.valueOf(algo)); }