Skip to content

Commit

Permalink
remove create_if_not_exists; see tikv#176
Browse files Browse the repository at this point in the history
Signed-off-by: gcxfd <i@rmw.link>
  • Loading branch information
gcxfd committed Jul 6, 2022
1 parent 784251f commit 31a546f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
3 changes: 0 additions & 3 deletions agate_bench/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ fn main() {
let chunk_size: u64 = sub_matches.value_of("chunk_size").unwrap().parse().unwrap();

let mut options = AgateOptions {
create_if_not_exists: true,
dir: directory.clone(),
value_dir: directory,
managed_txns: true,
Expand Down Expand Up @@ -209,7 +208,6 @@ fn main() {
let times: u64 = sub_matches.value_of("times").unwrap().parse().unwrap();

let mut options = AgateOptions {
create_if_not_exists: true,
sync_writes: true,
dir: directory.clone(),
value_dir: directory,
Expand Down Expand Up @@ -287,7 +285,6 @@ fn main() {
sub_matches.value_of("value_size").unwrap().parse().unwrap();

let mut options = AgateOptions {
create_if_not_exists: true,
sync_writes: true,
dir: directory.clone(),
value_dir: directory,
Expand Down
14 changes: 3 additions & 11 deletions src/db/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,6 @@ pub struct AgateOptions {
/// The default value of `managed_txns` is false.
pub managed_txns: bool,

/// Create the directory if the provided open path doesn't exists.
///
/// The default value of `create_if_not_exists` is false
#[getset(set = "pub")]
pub create_if_not_exists: bool,

/// Max entries in batch.
///
/// The default value of `max_batch_count` is `max_batch_size` / `MAX_NODE_SIZE`.
Expand Down Expand Up @@ -181,8 +175,6 @@ impl Default for AgateOptions {

managed_txns: false,

create_if_not_exists: false,

max_batch_count: 0,
max_batch_size: 0,
}
Expand Down Expand Up @@ -245,14 +237,14 @@ mod tests {
#[test]
fn test_options_set() {
let mut opt = AgateOptions::default();
opt.set_create_if_not_exists(true)
.set_in_memory(true)

opt.set_in_memory(true)
.set_value_log_file_size(256)
.set_num_memtables(3)
.set_value_log_max_entries(96)
.set_sync_writes(true)
.set_mem_table_size(1024);
assert!(opt.create_if_not_exists);

assert!(opt.in_memory);
assert_eq!(opt.value_log_file_size, 256);
assert_eq!(opt.num_memtables, 3);
Expand Down

0 comments on commit 31a546f

Please sign in to comment.