@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 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); } }
BlockBasedTableConfig tfc = new BlockBasedTableConfig(); tfc.setIndexType(IndexType.kHashSearch); options.setTableFormatConfig(tfc); options.useCappedPrefixExtractor(RocksDbKey.KEY_SIZE);
@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() .setMergeOperator(new StringAppendOperator()) .setCompactionStyle(CompactionStyle.LEVEL) .setLevelCompactionDynamicLevelBytes(true) .setTargetFileSizeBase(targetFileSize) .setMaxBytesForLevelBase(4 * targetFileSize) .setWriteBufferSize(writeBufferSize) .setMinWriteBufferNumberToMerge(3) .setMaxWriteBufferNumber(4) .setTableFormatConfig( new BlockBasedTableConfig() .setBlockCacheSize(blockCacheSize) .setBlockSize(blockSize) ); } },
List<ColumnFamilyHandle> colFamilyHandles = new ArrayList<ColumnFamilyHandle>(); RocksDB.loadLibrary(); BlockBasedTableConfig blockConfig = new BlockBasedTableConfig(); blockConfig.setFilter(new BloomFilter(16, false)); blockConfig.setBlockSize(4 * 1024); blockConfig.setFormatVersion(2); blockConfig.setNoBlockCache(true); blockConfig.setIndexType(IndexType.kTwoLevelIndexSearch); @SuppressWarnings("resource") DBOptions options = new DBOptions().setCreateIfMissing(true);
options.setDeleteObsoleteFilesPeriodMicros(TimeUnit.HOURS.toMicros(1)); BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockSize(blockSize); tableOptions.setBlockCacheSize(blockCacheSize); tableOptions.setFormatVersion(2); tableOptions.setChecksumType(ChecksumType.kxxHash); if (bloomFilterBitsPerKey > 0) { tableOptions.setFilter(new BloomFilter(bloomFilterBitsPerKey, false)); tableOptions.setCacheIndexAndFilterBlocks(true); options.setLevelCompactionDynamicLevelBytes(true);
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; }
final BlockBasedTableConfig tableConfig = new BlockBasedTableConfig(); tableConfig.setBlockCacheSize(BLOCK_CACHE_SIZE); tableConfig.setBlockSize(BLOCK_SIZE); tableConfig.setChecksumType(DEFAULT_CHECKSUM_TYPE);
@SuppressWarnings("unchecked") public void openDB(final ProcessorContext context) { final BlockBasedTableConfig tableConfig = new BlockBasedTableConfig(); tableConfig.setBlockCacheSize(BLOCK_CACHE_SIZE); tableConfig.setBlockSize(BLOCK_SIZE);
BlockBasedTableConfig blockConfig = new BlockBasedTableConfig(); blockConfig.setFilter(new BloomFilter(16, false)); blockConfig.setBlockSize(4 * 1024); blockConfig.setFormatVersion(2); blockConfig.setNoBlockCache(true); blockConfig.setIndexType(IndexType.kTwoLevelIndexSearch); blockConfig.setBlockCacheSize(GB * 2);
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; }
currentOptions.setMergeOperator(new StringAppendOperator()); BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockSize(32 * SizeUnit.KB); tableOptions.setBlockCacheSize(64 * SizeUnit.MB); tableOptions.setFilter(new BloomFilter(DEFAULT_BLOOM_FILTER_BITS, false)); tableOptions.setCacheIndexAndFilterBlocks(true);
@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); } }
BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockCacheSize(blockCacheSize).setBlockSize(blockSize); options.setTableFormatConfig(tableOptions);
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); }
options.setTableFormatConfig(tableCfg = new BlockBasedTableConfig()); tableCfg.setBlockSize(16 * 1024); tableCfg.setBlockCacheSize(32 * 1024 * 1024); tableCfg.setCacheIndexAndFilterBlocks(true); tableCfg.setPinL0FilterAndIndexBlocksInCache(true); tableCfg.setFilter(new BloomFilter(10, 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); } }
BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockCacheSize(blockCacheSize).setBlockSize(blockSize); options.setTableFormatConfig(tableOptions);
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); }
currentOptions.setMergeOperator(new StringAppendOperator()); BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockSize(32 * SizeUnit.KB); tableOptions.setBlockCacheSize(64 * SizeUnit.MB); tableOptions.setFilter(new BloomFilter(DEFAULT_BLOOM_FILTER_BITS, false)); tableOptions.setCacheIndexAndFilterBlocks(true);