Skip to content

Commit

Permalink
fix style check
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxiang1993 committed Jun 27, 2023
1 parent 31b2ef2 commit 989b419
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions wal/src/rocks_impl/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use common_types::{
use common_util::{error::BoxError, runtime::Runtime};
use log::{debug, info, warn};
use rocksdb::{
ColumnFamilyOptions, DBCompactionStyle, DBIterator, DBOptions, FifoCompactionOptions,
ReadOptions, SeekKey, Statistics, Writable, WriteBatch, DB,
rocksdb_options::ColumnFamilyDescriptor, ColumnFamilyOptions, DBCompactionStyle, DBIterator,
DBOptions, FifoCompactionOptions, ReadOptions, SeekKey, Statistics, Writable, WriteBatch, DB,
};
use snafu::ResultExt;
use tokio::sync::Mutex;
Expand All @@ -35,8 +35,6 @@ use crate::{
},
};

const ROCKSDB_DEFAULT_COLUMN_FAMILY: &str = "default";

/// Table unit in the Wal.
struct TableUnit {
/// id of the Region
Expand Down Expand Up @@ -650,20 +648,15 @@ impl Builder {
}
}

let default_cfd = {
let mut cfd = ColumnFamilyDescriptor::default();
cfd.options = cf_opts;
cfd
};
let db = DB::open_cf(
rocksdb_config,
&self.wal_path,
vec![default_cfd],
)
.map_err(|e| e.into())
.context(Open {
wal_path: self.wal_path.clone(),
})?;
let default_cfd = ColumnFamilyDescriptor {
options: cf_opts,
..ColumnFamilyDescriptor::default()
};
let db = DB::open_cf(rocksdb_config, &self.wal_path, vec![default_cfd])
.map_err(|e| e.into())
.context(Open {
wal_path: self.wal_path.clone(),
})?;
let rocks_impl = RocksImpl {
wal_path: self.wal_path,
db: Arc::new(db),
Expand Down

0 comments on commit 989b419

Please sign in to comment.