pub fn new_local_engine(path: &str, cfs: &[CfName]) -> Result<Box<Engine>> {
    let mut cfs_opts = Vec::with_capacity(cfs.len());
    let cfg_rocksdb = config::DbConfig::default();
    for cf in cfs {
        let cf_opt = match *cf {
            CF_DEFAULT => CFOptions::new(CF_DEFAULT, cfg_rocksdb.defaultcf.build_opt()),
            CF_LOCK => CFOptions::new(CF_LOCK, cfg_rocksdb.lockcf.build_opt()),
            CF_WRITE => CFOptions::new(CF_WRITE, cfg_rocksdb.writecf.build_opt()),
            CF_RAFT => CFOptions::new(CF_RAFT, cfg_rocksdb.raftcf.build_opt()),
            _ => CFOptions::new(*cf, ColumnFamilyOptions::new()),
        };
        cfs_opts.push(cf_opt);
    }
    EngineRocksdb::new(path, cfs, Some(cfs_opts)).map(|engine| -> Box<Engine> { Box::new(engine) })
}
/// Create a local Rocskdb engine. (Without raft, mainly for tests).
Create a local Rocskdb engine. (Without raft, mainly for tests).
Create a local Rocskdb engine . ( Without raft mainly for tests ) .
pub fn new_local_engine(path: &str, cfs: &[CfName]) -> Result<Box<Engine>> {
    let mut cfs_opts = Vec::with_capacity(cfs.len());
    let cfg_rocksdb = config::DbConfig::default();
    for cf in cfs {
        let cf_opt = match *cf {
            CF_DEFAULT => CFOptions::new(CF_DEFAULT, cfg_rocksdb.defaultcf.build_opt()),
            CF_LOCK => CFOptions::new(CF_LOCK, cfg_rocksdb.lockcf.build_opt()),
            CF_WRITE => CFOptions::new(CF_WRITE, cfg_rocksdb.writecf.build_opt()),
            CF_RAFT => CFOptions::new(CF_RAFT, cfg_rocksdb.raftcf.build_opt()),
            _ => CFOptions::new(*cf, ColumnFamilyOptions::new()),
        };
        cfs_opts.push(cf_opt);
    }
    EngineRocksdb::new(path, cfs, Some(cfs_opts)).map(|engine| -> Box<Engine> { Box::new(engine) })
}
pub fn new_local_engine ( path : & str , cfs : & [ CfName ] ) -> Result < Box < Engine > > { let mut cfs_opts = Vec :: with_capacity ( cfs . len ( ) ) ; let cfg_rocksdb = config :: DbConfig :: default ( ) ; for cf in cfs { let cf_opt = match * cf { CF_DEFAULT => CFOptions :: new ( CF_DEFAULT , cfg_rocksdb . defaultcf . build_opt ( ) ) , CF_LOCK => CFOptions :: new ( CF_LOCK , cfg_rocksdb . lockcf . build_opt ( ) ) , CF_WRITE => CFOptions :: new ( CF_WRITE , cfg_rocksdb . writecf . build_opt ( ) ) , CF_RAFT => CFOptions :: new ( CF_RAFT , cfg_rocksdb . raftcf . build_opt ( ) ) , _ => CFOptions :: new ( * cf , ColumnFamilyOptions :: new ( ) ) , } ; cfs_opts . push ( cf_opt ) ; } EngineRocksdb :: new ( path , cfs , Some ( cfs_opts ) ) . map ( | engine | -> Box < Engine > { Box :: new ( engine ) } ) }
Create a local Rocskdb engine.
Create a local Rocskdb engine .
path
&str
cfs
&[CfName]