public RocksDBStdSessions(HugeConfig config, String dataPath, String walPath, String database, String store) throws RocksDBException { super(database, store); this.conf = config; // Init options Options options = new Options(); RocksDBStdSessions.initOptions(this.conf, options, options, options); options.setWalDir(walPath); /* * Open RocksDB at the first time * Don't merge old CFs, we expect a clear DB when using this one */ this.rocksdb = RocksDB.open(options, dataPath); }
@Override public Options setWalDir(final String walDir) { assert(isOwningHandle()); setWalDir(nativeHandle_, walDir); return this; }
public RocksDBStdSessions(HugeConfig config, String dataPath, String walPath, String database, String store) throws RocksDBException { super(database, store); this.conf = config; // Init options Options options = new Options(); RocksDBStdSessions.initOptions(this.conf, options, options, options); options.setWalDir(walPath); /* * Open RocksDB at the first time * Don't merge old CFs, we expect a clear DB when using this one */ this.rocksdb = RocksDB.open(options, dataPath); }
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); }