Java Code Examples for org.rocksdb.Options#setIncreaseParallelism()
The following examples show how to use
org.rocksdb.Options#setIncreaseParallelism() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RocksDBWrapper.java From aion with MIT License | 5 votes |
private Options setupRocksDbOptions() { Options options = new Options(); options.setCreateIfMissing(true); options.setUseFsync(false); options.setCompressionType( enableDbCompression ? CompressionType.LZ4_COMPRESSION : CompressionType.NO_COMPRESSION); options.setBottommostCompressionType(CompressionType.ZLIB_COMPRESSION); options.setMinWriteBufferNumberToMerge(MIN_WRITE_BUFFER_NUMBER_TOMERGE); options.setLevel0StopWritesTrigger(LEVEL0_STOP_WRITES_TRIGGER); options.setLevel0SlowdownWritesTrigger(LEVEL0_SLOWDOWN_WRITES_TRIGGER); options.setAtomicFlush(true); options.setWriteBufferSize(this.writeBufferSize); options.setRandomAccessMaxBufferSize(this.readBufferSize); options.setParanoidChecks(true); options.setMaxOpenFiles(this.maxOpenFiles); options.setTableFormatConfig(setupBlockBasedTableConfig()); options.setDisableAutoCompactions(false); options.setIncreaseParallelism(max(1, Runtime.getRuntime().availableProcessors() / 2)); options.setLevelCompactionDynamicLevelBytes(true); options.setMaxBackgroundCompactions(MAX_BACKGROUND_COMPACTIONS); options.setMaxBackgroundFlushes(MAX_BACKGROUND_FLUSHES); options.setBytesPerSync(BYTES_PER_SYNC); options.setCompactionPriority(CompactionPriority.MinOverlappingRatio); options.optimizeLevelStyleCompaction(OPTIMIZE_LEVEL_STYLE_COMPACTION); return options; }
Example 2
Source File: JRocksDB.java From snowblossom with Apache License 2.0 | 5 votes |
protected RocksDB openRocksDB(String path) throws Exception { Options options = new Options(); options.setIncreaseParallelism(16); options.setCreateIfMissing(true); options.setAllowMmapReads(true); options.setKeepLogFileNum(5); //options.setAllowMmapWrites(true); return RocksDB.open(options, path); }
Example 3
Source File: JRocksDB.java From jelectrum with MIT License | 5 votes |
public JRocksDB(Config config, EventLog log) throws Exception { super(config); this.log = log; config.require("rocksdb_path"); String path = config.get("rocksdb_path"); RocksDB.loadLibrary(); Options options = new Options(); options.setIncreaseParallelism(16); options.setCreateIfMissing(true); options.setAllowMmapReads(true); //options.setAllowMmapWrites(true); sharedWriteOptions = new WriteOptions(); sharedWriteOptions.setDisableWAL(true); sharedWriteOptions.setSync(false); db = RocksDB.open(options, path); open(); }