pub fn open(path: &Path, opts: StoreOptions) -> DBStore {
        debug!("opening {:?} with {:?}", path, &opts);
        let mut db_opts = rocksdb::Options::default();
        db_opts.create_if_missing(true);
        db_opts.set_compaction_style(rocksdb::DBCompactionStyle::Level);
        db_opts.set_compression_type(rocksdb::DBCompressionType::Snappy);
        db_opts.set_target_file_size_base(128 << 20);
        db_opts.set_write_buffer_size(64 << 20);
        db_opts.increase_parallelism(2);
        db_opts.set_min_write_buffer_number(2);
        db_opts.set_max_write_buffer_number(3);
        db_opts.set_disable_auto_compactions(opts.bulk_import);
        db_opts.set_advise_random_on_open(!opts.bulk_import);

        let mut block_opts = rocksdb::BlockBasedOptions::default();
        block_opts.set_block_size(256 << 10);
        DBStore {
            db: rocksdb::DB::open(&db_opts, &path).unwrap(),
            opts: opts,
        }
    }
/// Opens a new RocksDB at the specified location.
Opens a new RocksDB at the specified location.
Opens a new RocksDB at the specified location .
pub fn open(path: &Path, opts: StoreOptions) -> DBStore {
        debug!("opening {:?} with {:?}", path, &opts);
        let mut db_opts = rocksdb::Options::default();
        db_opts.create_if_missing(true);
        db_opts.set_compaction_style(rocksdb::DBCompactionStyle::Level);
        db_opts.set_compression_type(rocksdb::DBCompressionType::Snappy);
        db_opts.set_target_file_size_base(128 << 20);
        db_opts.set_write_buffer_size(64 << 20);
        db_opts.increase_parallelism(2);
        db_opts.set_min_write_buffer_number(2);
        db_opts.set_max_write_buffer_number(3);
        db_opts.set_disable_auto_compactions(opts.bulk_import);
        db_opts.set_advise_random_on_open(!opts.bulk_import);
        let mut block_opts = rocksdb::BlockBasedOptions::default();
        block_opts.set_block_size(256 << 10);
        DBStore {
            db: rocksdb::DB::open(&db_opts, &path).unwrap(),
            opts: opts,
        }
    }
pub fn open ( path : & Path , opts : StoreOptions ) -> DBStore { debug ! ( " " path opts ) ; let mut db_opts = rocksdb :: Options :: default ( ) ; db_opts . create_if_missing ( true ) ; db_opts . set_compaction_style ( rocksdb :: DBCompactionStyle :: Level ) ; db_opts . set_compression_type ( rocksdb :: DBCompressionType :: Snappy ) ; db_opts . set_target_file_size_base ( 128 << 20 ) ; db_opts . set_write_buffer_size ( 64 << 20 ) ; db_opts . increase_parallelism ( 2 ) ; db_opts . set_min_write_buffer_number ( 2 ) ; db_opts . set_max_write_buffer_number ( 3 ) ; db_opts . set_disable_auto_compactions ( opts . bulk_import ) ; db_opts . set_advise_random_on_open ( ! opts . bulk_import ) ; let mut block_opts = rocksdb :: BlockBasedOptions :: default ( ) ; block_opts . set_block_size ( 256 << 10 ) ; DBStore { db : rocksdb :: DB :: open ( & db_opts , & path ) . unwrap ( ) , opts : opts , } }
Opens a new RocksDB at the specified location.
Opens a new RocksDB at the specified location .
path
&Path
opts
StoreOptions
path
&Path
opts
StoreOptions