options.setTableFormatConfig(tfc); options.useCappedPrefixExtractor(RocksDbKey.KEY_SIZE);
options.setTableFormatConfig(tableCfg = new BlockBasedTableConfig()); tableCfg.setBlockSize(16 * 1024); tableCfg.setBlockCacheSize(32 * 1024 * 1024);
@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); } }
currentOptions.setTableFormatConfig(tableOptions);
@Override public void setConfig(final String storeName, final Options options, final Map<String, Object> configs) { BlockBasedTableConfig tableConfig = new org.rocksdb.BlockBasedTableConfig(); tableConfig.setBlockCacheSize(2 * 1024 * 1024L); tableConfig.setBlockSize(2 * 1024L); tableConfig.setCacheIndexAndFilterBlocks(true); options.setTableFormatConfig(tableConfig); options.setMaxWriteBufferNumber(2); options.optimizeFiltersForHits(); } }
private Options createDatabaseOptions() { BlockBasedTableConfig tableFormatConfig = new BlockBasedTableConfig() .setBlockSize(cacheBlockSizeKB * 1024L) .setBlockCacheSize(readCacheSizeMB * 1024L * 1024L) .setCacheIndexAndFilterBlocks(true); return new Options() .setCreateIfMissing(true) .setDbLogDir(Paths.get(this.dbDir, DB_LOG_DIR).toString()) .setWalDir(Paths.get(this.dbDir, DB_WRITE_AHEAD_LOG_DIR).toString()) .setWalTtlSeconds(0) .setWalSizeLimitMB(MAX_WRITE_AHEAD_LOG_SIZE_MB) .setWriteBufferSize(writeBufferSizeMB * 1024L * 1024L) .setMaxWriteBufferNumber(MAX_WRITE_BUFFER_NUMBER) .setMinWriteBufferNumberToMerge(MIN_WRITE_BUFFER_NUMBER_TO_MERGE) .setTableFormatConfig(tableFormatConfig) .setOptimizeFiltersForHits(true) .setUseDirectReads(true); }
options.setTableFormatConfig(tableConfig); options.setWriteBufferSize(WRITE_BUFFER_SIZE); options.setCompressionType(COMPRESSION_TYPE);
options.setTableFormatConfig(blockConfig); File f = new File(fileName + File.separator); f.mkdirs();
BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockCacheSize(blockCacheSize).setBlockSize(blockSize); options.setTableFormatConfig(tableOptions);
BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockCacheSize(blockCacheSize).setBlockSize(blockSize); options.setTableFormatConfig(tableOptions);
BlockBasedTableConfig tableOptions = new BlockBasedTableConfig(); tableOptions.setBlockCacheSize(blockCacheSize).setBlockSize(blockSize); options.setTableFormatConfig(tableOptions);
@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); } }
options.setLevelCompactionDynamicLevelBytes(true); options.setTableFormatConfig(tableOptions);