Search in sources :

Example 6 with CFHandle

use of com.baidu.hugegraph.backend.store.rocksdb.OpenedRocksDB.CFHandle in project incubator-hugegraph by apache.

the class RocksDBStdSessions method openRocksDB.

private static OpenedRocksDB openRocksDB(HugeConfig config, String dataPath, String walPath) throws RocksDBException {
    // Init options
    Options options = new Options();
    RocksDBStdSessions.initOptions(config, options, options, options, options);
    options.setWalDir(walPath);
    SstFileManager sstFileManager = new SstFileManager(Env.getDefault());
    options.setSstFileManager(sstFileManager);
    /*
         * Open RocksDB at the first time
         * Don't merge old CFs, we expect a clear DB when using this one
         */
    RocksDB rocksdb = RocksDB.open(options, dataPath);
    Map<String, CFHandle> cfs = new ConcurrentHashMap<>();
    return new OpenedRocksDB(rocksdb, cfs, sstFileManager);
}
Also used : ColumnFamilyOptions(org.rocksdb.ColumnFamilyOptions) WriteOptions(org.rocksdb.WriteOptions) Options(org.rocksdb.Options) CoreOptions(com.baidu.hugegraph.config.CoreOptions) DBOptions(org.rocksdb.DBOptions) CFHandle(com.baidu.hugegraph.backend.store.rocksdb.OpenedRocksDB.CFHandle) RocksDB(org.rocksdb.RocksDB) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) SstFileManager(org.rocksdb.SstFileManager)

Aggregations

CFHandle (com.baidu.hugegraph.backend.store.rocksdb.OpenedRocksDB.CFHandle)6 ArrayList (java.util.ArrayList)3 ColumnFamilyHandle (org.rocksdb.ColumnFamilyHandle)3 ColumnFamilyOptions (org.rocksdb.ColumnFamilyOptions)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)2 ColumnFamilyDescriptor (org.rocksdb.ColumnFamilyDescriptor)2 DBOptions (org.rocksdb.DBOptions)2 RocksDB (org.rocksdb.RocksDB)2 SstFileManager (org.rocksdb.SstFileManager)2 BackendException (com.baidu.hugegraph.backend.BackendException)1 CoreOptions (com.baidu.hugegraph.config.CoreOptions)1 Path (java.nio.file.Path)1 Options (org.rocksdb.Options)1 WriteOptions (org.rocksdb.WriteOptions)1