tableCfg.setCacheIndexAndFilterBlocks(true); tableCfg.setPinL0FilterAndIndexBlocksInCache(true); tableCfg.setFilter(new BloomFilter(10, false));
@Override public ColumnFamilyOptions createColumnOptions() { final long blockCacheSize = 256 * 1024 * 1024; final long blockSize = 128 * 1024; final long targetFileSize = 256 * 1024 * 1024; final long writeBufferSize = 64 * 1024 * 1024; return new ColumnFamilyOptions() .setCompactionStyle(CompactionStyle.LEVEL) .setLevelCompactionDynamicLevelBytes(true) .setTargetFileSizeBase(targetFileSize) .setMaxBytesForLevelBase(4 * targetFileSize) .setWriteBufferSize(writeBufferSize) .setMinWriteBufferNumberToMerge(3) .setMaxWriteBufferNumber(4) .setTableFormatConfig( new BlockBasedTableConfig() .setBlockCacheSize(blockCacheSize) .setBlockSize(blockSize) .setFilter(new BloomFilter()) ); } },
tableOptions.setFilter(new BloomFilter(DEFAULT_BLOOM_FILTER_BITS, false));
@Override protected void init() throws FailStoreException { try { options = new Options(); options.setCreateIfMissing(true) .setWriteBufferSize(8 * SizeUnit.KB) .setMaxWriteBufferNumber(3) .setMaxBackgroundCompactions(10) .setCompressionType(CompressionType.SNAPPY_COMPRESSION) .setCompactionStyle(CompactionStyle.UNIVERSAL); Filter bloomFilter = new BloomFilter(10); BlockBasedTableConfig tableConfig = new BlockBasedTableConfig(); tableConfig.setBlockCacheSize(64 * SizeUnit.KB) .setFilter(bloomFilter) .setCacheNumShardBits(6) .setBlockSizeDeviation(5) .setBlockRestartInterval(10) .setCacheIndexAndFilterBlocks(true) .setHashIndexAllowCollision(false) .setBlockCacheCompressedSize(64 * SizeUnit.KB) .setBlockCacheCompressedNumShardBits(10); options.setTableFormatConfig(tableConfig); } catch (Exception e) { throw new FailStoreException(e); } }
@Override protected void init() throws FailStoreException { try { options = new Options(); options.setCreateIfMissing(true) .setWriteBufferSize(8 * SizeUnit.KB) .setMaxWriteBufferNumber(3) .setMaxBackgroundCompactions(10) .setCompressionType(CompressionType.SNAPPY_COMPRESSION) .setCompactionStyle(CompactionStyle.UNIVERSAL); Filter bloomFilter = new BloomFilter(10); BlockBasedTableConfig tableConfig = new BlockBasedTableConfig(); tableConfig.setBlockCacheSize(64 * SizeUnit.KB) .setFilter(bloomFilter) .setCacheNumShardBits(6) .setBlockSizeDeviation(5) .setBlockRestartInterval(10) .setCacheIndexAndFilterBlocks(true) .setHashIndexAllowCollision(false) .setBlockCacheCompressedSize(64 * SizeUnit.KB) .setBlockCacheCompressedNumShardBits(10); options.setTableFormatConfig(tableConfig); } catch (Exception e) { throw new FailStoreException(e); } }
tableOptions.setFilter(new BloomFilter(DEFAULT_BLOOM_FILTER_BITS, false));
private ColumnFamilyOptions newColFamilyOptions() { ColumnFamilyOptions colFamilyOptions = new ColumnFamilyOptions(); // enable bloom filter to speed up RocksDB.get() calls BlockBasedTableConfig tableFormatConfig = new BlockBasedTableConfig(); BloomFilter bloomFilter = new BloomFilter(); tableFormatConfig.setFilter(bloomFilter); colFamilyOptions.setTableFormatConfig(tableFormatConfig); // cause the Windows jar doesn't come with // snappy and hence fails colFamilyOptions.setCompressionType(CompressionType.NO_COMPRESSION); return colFamilyOptions; }
private ColumnFamilyOptions newColFamilyOptions() { ColumnFamilyOptions colFamilyOptions = new ColumnFamilyOptions(); // enable bloom filter to speed up RocksDB.get() calls BlockBasedTableConfig tableFormatConfig = new BlockBasedTableConfig(); BloomFilter bloomFilter = new BloomFilter(); tableFormatConfig.setFilter(bloomFilter); colFamilyOptions.setTableFormatConfig(tableFormatConfig); // cause the Windows jar doesn't come with // snappy and hence fails colFamilyOptions.setCompressionType(CompressionType.NO_COMPRESSION); return colFamilyOptions; }
blockConfig.setFilter(new BloomFilter(16, false));
public RocksdbDAGStore(RocksDB db) { this.db = db; try { // enable bloom filter to speed up RocksDB.get() calls BlockBasedTableConfig tableFormatConfig = new BlockBasedTableConfig(); bloomFilter = new BloomFilter(); tableFormatConfig.setFilter(bloomFilter); colFamilyOptions = new ColumnFamilyOptions(); colFamilyOptions.setTableFormatConfig(tableFormatConfig); byte[] tableNameKey = "trees".getBytes(Charsets.UTF_8); ColumnFamilyDescriptor columnDescriptor = new ColumnFamilyDescriptor(tableNameKey, colFamilyOptions); column = db.createColumnFamily(columnDescriptor); } catch (RocksDBException e) { throw Throwables.propagate(e); } writeOptions = new WriteOptions(); writeOptions.setDisableWAL(true); writeOptions.setSync(false); readOptions = new ReadOptions(); readOptions.setFillCache(false).setVerifyChecksums(false); }
public RocksdbNodeStore(RocksDB db) { this.db = db; try { // enable bloom filter to speed up RocksDB.get() calls BlockBasedTableConfig tableFormatConfig = new BlockBasedTableConfig(); bloomFilter = new BloomFilter(); tableFormatConfig.setFilter(bloomFilter); colFamilyOptions = new ColumnFamilyOptions(); colFamilyOptions.setTableFormatConfig(tableFormatConfig); byte[] tableNameKey = "nodes".getBytes(Charsets.UTF_8); ColumnFamilyDescriptor columnDescriptor = new ColumnFamilyDescriptor(tableNameKey, colFamilyOptions); column = db.createColumnFamily(columnDescriptor); } catch (RocksDBException e) { throw Throwables.propagate(e); } this.writeOptions = new WriteOptions(); writeOptions.setDisableWAL(true); writeOptions.setSync(false); readOptions = new ReadOptions(); readOptions.setFillCache(false).setVerifyChecksums(false); }
@Override public ColumnFamilyOptions createColumnOptions() { final long blockCacheSize = 256 * 1024 * 1024; final long blockSize = 128 * 1024; final long targetFileSize = 256 * 1024 * 1024; final long writeBufferSize = 64 * 1024 * 1024; return new ColumnFamilyOptions() .setCompactionStyle(CompactionStyle.LEVEL) .setLevelCompactionDynamicLevelBytes(true) .setTargetFileSizeBase(targetFileSize) .setMaxBytesForLevelBase(4 * targetFileSize) .setWriteBufferSize(writeBufferSize) .setMinWriteBufferNumberToMerge(3) .setMaxWriteBufferNumber(4) .setTableFormatConfig( new BlockBasedTableConfig() .setBlockCacheSize(blockCacheSize) .setBlockSize(blockSize) .setFilter(new BloomFilter()) ); } },
@Override public ColumnFamilyOptions createColumnOptions() { final long blockCacheSize = 256 * 1024 * 1024; final long blockSize = 128 * 1024; final long targetFileSize = 256 * 1024 * 1024; final long writeBufferSize = 64 * 1024 * 1024; return new ColumnFamilyOptions() .setCompactionStyle(CompactionStyle.LEVEL) .setLevelCompactionDynamicLevelBytes(true) .setTargetFileSizeBase(targetFileSize) .setMaxBytesForLevelBase(4 * targetFileSize) .setWriteBufferSize(writeBufferSize) .setMinWriteBufferNumberToMerge(3) .setMaxWriteBufferNumber(4) .setTableFormatConfig( new BlockBasedTableConfig() .setBlockCacheSize(blockCacheSize) .setBlockSize(blockSize) .setFilter(new BloomFilter()) ); } },
blockConfig.setFilter(new BloomFilter(16, false));
@Override protected void init() throws FailStoreException { try { options = new Options(); options.setCreateIfMissing(true) .setWriteBufferSize(8 * SizeUnit.KB) .setMaxWriteBufferNumber(3) .setMaxBackgroundCompactions(10) .setCompressionType(CompressionType.SNAPPY_COMPRESSION) .setCompactionStyle(CompactionStyle.UNIVERSAL); Filter bloomFilter = new BloomFilter(10); BlockBasedTableConfig tableConfig = new BlockBasedTableConfig(); tableConfig.setBlockCacheSize(64 * SizeUnit.KB) .setFilter(bloomFilter) .setCacheNumShardBits(6) .setBlockSizeDeviation(5) .setBlockRestartInterval(10) .setCacheIndexAndFilterBlocks(true) .setHashIndexAllowCollision(false) .setBlockCacheCompressedSize(64 * SizeUnit.KB) .setBlockCacheCompressedNumShardBits(10); options.setTableFormatConfig(tableConfig); } catch (Exception e) { throw new FailStoreException(e); } }
tableOptions.setChecksumType(ChecksumType.kxxHash); if (bloomFilterBitsPerKey > 0) { tableOptions.setFilter(new BloomFilter(bloomFilterBitsPerKey, false));