options.setMaxBackgroundFlushes(2); options.setMaxBackgroundCompactions(2); options.setCompactionStyle(CompactionStyle.LEVEL); options.setNumLevels(levelNum); options.setLevelZeroFileNumCompactionTrigger(compactionTriggerNum);
public RocksDBLookupBuilder(TableDesc tableDesc, String[] keyColumns, String dbPath) { this.tableDesc = tableDesc; this.encoder = new RocksDBLookupRowEncoder(tableDesc, keyColumns); this.dbPath = dbPath; this.writeBatchSize = 500; this.options = new Options(); options.setCreateIfMissing(true).setWriteBufferSize(8 * SizeUnit.KB).setMaxWriteBufferNumber(3) .setMaxBackgroundCompactions(5).setCompressionType(CompressionType.SNAPPY_COMPRESSION) .setCompactionStyle(CompactionStyle.UNIVERSAL); }
@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.setMaxBackgroundFlushes(2); currentOptions.setMaxBackgroundCompactions(2); currentOptions.setCompactionStyle(CompactionStyle.LEVEL); currentOptions.setLevelZeroFileNumCompactionTrigger(4); currentOptions.setLevelZeroSlowdownWritesTrigger(20);
@Override public Options setCompactionStyle( final CompactionStyle compactionStyle) { setCompactionStyle(nativeHandle_, compactionStyle.getValue()); return this; }
.setCreateMissingColumnFamilies(true) .optimizeLevelStyleCompaction(memtableSize) .setCompactionStyle(CompactionStyle.LEVEL) .setNumLevels(4) .setIncreaseParallelism(parallelism)
public RocksDBLookupBuilder(TableDesc tableDesc, String[] keyColumns, String dbPath) { this.tableDesc = tableDesc; this.encoder = new RocksDBLookupRowEncoder(tableDesc, keyColumns); this.dbPath = dbPath; this.writeBatchSize = 500; this.options = new Options(); options.setCreateIfMissing(true).setWriteBufferSize(8 * SizeUnit.KB).setMaxWriteBufferNumber(3) .setMaxBackgroundCompactions(5).setCompressionType(CompressionType.SNAPPY_COMPRESSION) .setCompactionStyle(CompactionStyle.UNIVERSAL); }
options.setWriteBufferSize(WRITE_BUFFER_SIZE); options.setCompressionType(COMPRESSION_TYPE); options.setCompactionStyle(COMPACTION_STYLE); options.setMaxWriteBufferNumber(MAX_WRITE_BUFFERS); options.setCreateIfMissing(true);
Options options = new Options(); options.setCreateIfMissing(true); options.setCompactionStyle(CompactionStyle.LEVEL); options.setCompressionType(CompressionType.NO_COMPRESSION); options.setLevel0FileNumCompactionTrigger(8);
", overwriting to " + compactionStyle.name()); options.setCompactionStyle(compactionStyle);
", overwriting to " + compactionStyle.name()); options.setCompactionStyle(compactionStyle);
", overwriting to " + compactionStyle.name()); options.setCompactionStyle(compactionStyle);
@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); } }